pax_global_header00006660000000000000000000000064152326217420014516gustar00rootroot0000000000000052 comment=aefeac310a824190502425fc89f0b72d0237dd18 webpack-enhanced-resolve-7dfc9bc/000077500000000000000000000000001523262174200171355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/.changeset/000077500000000000000000000000001523262174200211545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/.changeset/README.md000066400000000000000000000010001523262174200224220ustar00rootroot00000000000000# Changesets Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets). We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md). webpack-enhanced-resolve-7dfc9bc/.changeset/changelog-generator.mjs000066400000000000000000000067701523262174200256140ustar00rootroot00000000000000import { getInfo, getInfoFromPullRequest } from "@changesets/get-github-info"; /** @typedef {import("@changesets/types").ChangelogFunctions} ChangelogFunctions */ /** * @returns {{ GITHUB_SERVER_URL: string }} value */ function readEnv() { const GITHUB_SERVER_URL = process.env.GITHUB_SERVER_URL || "https://github.com"; return { GITHUB_SERVER_URL }; } /** @type {ChangelogFunctions} */ const changelogFunctions = { getDependencyReleaseLine: async ( changesets, dependenciesUpdated, options, ) => { if (!options.repo) { throw new Error( 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]', ); } if (dependenciesUpdated.length === 0) return ""; const changesetLink = `- Updated dependencies [${( await Promise.all( changesets.map(async (cs) => { if (cs.commit) { const { links } = await getInfo({ repo: options.repo, commit: cs.commit, }); return links.commit; } }), ) ) .filter(Boolean) .join(", ")}]:`; const updatedDependenciesList = dependenciesUpdated.map( (dependency) => ` - ${dependency.name}@${dependency.newVersion}`, ); return [changesetLink, ...updatedDependenciesList].join("\n"); }, getReleaseLine: async (changeset, type, options) => { const { GITHUB_SERVER_URL } = readEnv(); if (!options || !options.repo) { throw new Error( 'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]', ); } /** @type {number | undefined} */ let prFromSummary; /** @type {string | undefined} */ let commitFromSummary; /** @type {string[]} */ const usersFromSummary = []; const replacedChangelog = changeset.summary .replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => { const num = Number(pr); if (!Number.isNaN(num)) prFromSummary = num; return ""; }) .replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => { commitFromSummary = commit; return ""; }) .replaceAll(/^\s*(?:author|user):\s*@?([^\s]+)/gim, (_, user) => { usersFromSummary.push(user); return ""; }) .trim(); const [firstLine, ...futureLines] = replacedChangelog .split("\n") .map((l) => l.trimEnd()); const links = await (async () => { if (prFromSummary !== undefined) { let { links } = await getInfoFromPullRequest({ repo: options.repo, pull: prFromSummary, }); if (commitFromSummary) { const shortCommitId = commitFromSummary.slice(0, 7); links = { ...links, commit: `[\`${shortCommitId}\`](${GITHUB_SERVER_URL}/${options.repo}/commit/${commitFromSummary})`, }; } return links; } const commitToFetchFrom = commitFromSummary || changeset.commit; if (commitToFetchFrom) { const { links } = await getInfo({ repo: options.repo, commit: commitToFetchFrom, }); return links; } return { commit: null, pull: null, user: null, }; })(); const users = usersFromSummary.length ? usersFromSummary .map( (userFromSummary) => `[@${userFromSummary}](${GITHUB_SERVER_URL}/${userFromSummary})`, ) .join(", ") : links.user; let suffix = ""; if (links.pull || links.commit || users) { suffix = `(${users ? `by ${users} ` : ""}in ${links.pull || links.commit})`; } return `\n\n- ${firstLine} ${suffix}\n${futureLines.map((l) => ` ${l}`).join("\n")}`; }, }; export default changelogFunctions; webpack-enhanced-resolve-7dfc9bc/.changeset/config.json000066400000000000000000000004621523262174200233160ustar00rootroot00000000000000{ "$schema": "https://unpkg.com/@changesets/config@3.1.3/schema.json", "changelog": [ "./changelog-generator.mjs", { "repo": "webpack/enhanced-resolve" } ], "fixed": [], "linked": [], "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] } webpack-enhanced-resolve-7dfc9bc/.cspell.json000066400000000000000000000017101523262174200213670ustar00rootroot00000000000000{ "version": "0.2", "words": [ "abcxyz", "addrs", "codspeed", "megapkg", "stabilise", "tinybench", "walltime", "abortable", "anotherhashishere", "arcanis", "Builtins", "camelcase", "complexm", "endregion", "entrypoints", "filesystems", "hashishere", "jsons", "Kopeykin", "Koppers", "Maël", "memfs", "mergeable", "Nison", "opensource", "pjson", "pnpapi", "sokra", "subpaths", "tapable", "undescribed", "unreviewed", "vankop", "wpck", "zapp", "zipp", "zippi", "zizizi", "codecov", "xiaoxiaojx", "Natsu", "tsconfigs", "preact", "compat", "Sindre", "Sorhus", "readlink", "extensionless", "ENOENT", "hardlinks", "denoland" ], "ignorePaths": [ "package.json", "package-lock.json", "coverage", "*.log", ".gitignore", "CHANGELOG.md" ] } webpack-enhanced-resolve-7dfc9bc/.editorconfig000066400000000000000000000003701523262174200216120ustar00rootroot00000000000000root = true [*] indent_style = tab indent_size = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true max_line_length = 80 [*.{yml,yaml,json}] indent_style = space indent_size = 2 [*.md] trim_trailing_whitespace = false webpack-enhanced-resolve-7dfc9bc/.github/000077500000000000000000000000001523262174200204755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/.github/dependabot.yml000066400000000000000000000010601523262174200233220ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: npm directory: "/" schedule: interval: "weekly" open-pull-requests-limit: 20 labels: - dependencies versioning-strategy: widen groups: dependencies: patterns: - "*" update-types: - "minor" - "patch" - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" open-pull-requests-limit: 20 labels: - dependencies groups: dependencies: patterns: - "*" webpack-enhanced-resolve-7dfc9bc/.github/workflows/000077500000000000000000000000001523262174200225325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/.github/workflows/benchmarks.yml000066400000000000000000000020141523262174200253670ustar00rootroot00000000000000name: Benchmarks on: push: branches: [main] pull_request: branches: [main] workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: benchmark: runs-on: ubuntu-latest permissions: contents: read id-token: write # Required for OIDC authentication with CodSpeed pull-requests: write strategy: fail-fast: false matrix: mode: ["simulation", "memory"] name: benchmark (${{ matrix.mode }}) steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: Use Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: lts/* cache: npm - run: npm ci - name: Run benchmarks uses: CodSpeedHQ/action@f99becdce5e5d51fd556489ebef684f4ecfd6286 # v4.18.5 with: run: npm run benchmark mode: ${{ matrix.mode }} webpack-enhanced-resolve-7dfc9bc/.github/workflows/cross-runtime.yml000066400000000000000000000056651523262174200261030ustar00rootroot00000000000000name: Cross-runtime on: push: branches: [main] pull_request: branches: [main] permissions: contents: read # Runs the real test suite on non-Node runtimes. Bun uses its built-in # jest-compatible runner; Deno runs the actual jest via its Node compatibility. # The browser job bundles the core resolver for the browser and runs it both in # a web-globals sandbox and in real headless Chromium (the Node-based jest suite # cannot run in a browser). jobs: bun: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Bun uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version: latest - name: Install dependencies run: bun install env: HUSKY: "0" - name: Run tests run: bun test test/ deno: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: lts/* cache: npm - name: Install dependencies run: npm ci env: HUSKY: "0" # jest is no longer a project dev-dep (the Node.js test runner is used # instead), so install it ad-hoc just for this job. The bridge shim # (`test/_runner.js`) adapts the suite to jest's globals exactly as it # does on the legacy-test matrix. - name: Install jest run: npm install --no-save --no-package-lock --no-audit jest@^30 - name: Use Deno uses: denoland/setup-deno@22d081ff2d3a40755e97629de92e3bcbfa7cf2ed # v2.0.5 with: deno-version: v2.x - name: Run tests (jest via Deno node compatibility) run: deno run -A --node-modules-dir=auto node_modules/jest/bin/jest.js browser: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: lts/* cache: npm - name: Install dependencies run: npm ci env: HUSKY: "0" # webpack bundles the core resolver for the browser as an ES module # (experiments.outputModule), resolving the browser field and failing on # any Node builtin that is not shimmed. First run it in a web-globals-only # sandbox (fast, deterministic), then in real headless Chromium. - name: Verify browser bundle in a web-globals sandbox run: npm run test:browser - name: Install Playwright Chromium run: | npm install --no-save playwright npx playwright install --with-deps chromium - name: Run resolver in headless Chromium run: node test/smoke/browser-playwright.cjs webpack-enhanced-resolve-7dfc9bc/.github/workflows/dependabot.yml000066400000000000000000000024371523262174200253700ustar00rootroot00000000000000name: Dependabot on: pull_request permissions: contents: write pull-requests: write jobs: dependabot-auto-merge: runs-on: ubuntu-latest if: github.actor == 'dependabot[bot]' steps: - name: Generate Token uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 id: app-token with: app-id: ${{ secrets.BOT_APP_ID }} private-key: ${{ secrets.BOT_PRIVATE_KEY }} - name: Dependabot metadata id: dependabot-metadata uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 with: github-token: "${{ steps.app-token.outputs.token }}" - name: Enable auto-merge for Dependabot PRs if: steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' run: | if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ]; then gh pr review --approve "$PR_URL" else echo "PR already approved, skipping additional approvals to minimize emails/notification noise."; fi gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ steps.app-token.outputs.token }} webpack-enhanced-resolve-7dfc9bc/.github/workflows/release.yml000066400000000000000000000022521523262174200246760ustar00rootroot00000000000000name: Release on: push: branches: - main concurrency: ${{ github.workflow }}-${{ github.ref }} permissions: id-token: write # Required for OIDC contents: write pull-requests: write jobs: release: if: github.repository == 'webpack/enhanced-resolve' name: Release runs-on: ubuntu-latest outputs: published: ${{ steps.changesets.outputs.published }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: lts/* cache: npm - run: npm ci - name: Create Release Pull Request or Publish to npm id: changesets uses: changesets/action@a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0 with: version: npm run version publish: npm run release commit: "chore(release): new release" title: "chore(release): new release" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: "" # https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868 webpack-enhanced-resolve-7dfc9bc/.github/workflows/test.yml000066400000000000000000000105041523262174200242340ustar00rootroot00000000000000name: Test on: push: branches: [main] pull_request: branches: [main] permissions: contents: read jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: lts/* cache: npm - run: npm ci - run: npm run lint test: strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x, 25.x] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # macOS arm64 runners don't ship Node.js 10/12/14, so force x64. - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 id: calculate_architecture with: result-encoding: string script: | if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '10.x' || '${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) { return "x64" } else { return '' } - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: ${{ matrix.node-version }} architecture: ${{ steps.calculate_architecture.outputs.result }} # Legacy Node (10-16) reinstalls deps after dropping the lockfile, # so there's nothing for setup-node's npm cache to key on. cache: ${{ (matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x') && '' || 'npm' }} # TODO: drop the legacy install + jest steps below once `engines.node` # is bumped to >= 18. That also makes `jest.config.js`, the jest branch # of `test/_runner.js`, and `test/polyfill-text-encoding.js` dead code. # # The `node:test` based suite needs Node.js 18+; the library itself # still supports Node.js >= 10.13, so legacy versions run the same test # files under jest via the runner shim (`test/_runner.js`). jest, memfs # and the runtime deps are installed ad-hoc so the modern dev toolchain # (eslint, typescript, prettier) is never required by the legacy leg. - name: Install jest (Node 10) if: matrix.node-version == '10.x' shell: bash run: | rm -f package-lock.json npm config set progress false yarn add -D jest@^27 memfs@^3 --ignore-scripts --ignore-engines - name: Install jest (Node 12-16) if: matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x' shell: bash run: | rm -f package-lock.json npm config set progress false npm install -g npm@7 npm install -D jest@^27 memfs@^3 --ignore-scripts --no-audit --no-save --no-package-lock - name: Install dependencies if: matrix.node-version != '10.x' && matrix.node-version != '12.x' && matrix.node-version != '14.x' && matrix.node-version != '16.x' run: npm ci - name: Run tests (legacy via jest) if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x' run: npx jest --ci # The built-in coverage lcov reporter and `--test-coverage-include` are # only available on Node.js 22+, so 18/20 run the suite without # collecting coverage. - name: Run tests if: matrix.node-version == '18.x' || matrix.node-version == '20.x' run: npm run test:only - name: Run tests with coverage if: matrix.node-version == '22.x' || matrix.node-version == '24.x' || matrix.node-version == '25.x' run: npm run test:coverage - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 if: matrix.node-version == '22.x' || matrix.node-version == '24.x' || matrix.node-version == '25.x' with: files: ./coverage/lcov.info flags: integration token: ${{ secrets.CODECOV_TOKEN }} webpack-enhanced-resolve-7dfc9bc/.gitignore000066400000000000000000000001571523262174200211300ustar00rootroot00000000000000/node_modules /coverage /.nyc_output *.log .eslintcache .cspellcache # IDE .idea .vscode .DS_Store yarn.lock webpack-enhanced-resolve-7dfc9bc/.husky/000077500000000000000000000000001523262174200203565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/.husky/pre-commit000066400000000000000000000000351523262174200223530ustar00rootroot00000000000000npx --no-install lint-staged webpack-enhanced-resolve-7dfc9bc/.prettierignore000066400000000000000000000001241523262174200221750ustar00rootroot00000000000000package.json package-lock.json test/**/*.* !test/*.js # Generated files types.d.ts webpack-enhanced-resolve-7dfc9bc/.prettierrc.js000066400000000000000000000005011523262174200217300ustar00rootroot00000000000000"use strict"; module.exports = { printWidth: 80, useTabs: true, tabWidth: 2, trailingComma: "all", arrowParens: "always", overrides: [ { files: "*.json", options: { parser: "json", useTabs: false, }, }, { files: "*.{cts,mts,ts}", options: { parser: "typescript", }, }, ], }; webpack-enhanced-resolve-7dfc9bc/AGENTS.md000066400000000000000000000006741523262174200204470ustar00rootroot00000000000000> CLAUDE.md is a symlink to AGENTS.md. They are the same file. **Before starting any task, you MUST:** 1. Fetch and read [webpack/webpack AGENTS.md](https://github.com/webpack/webpack/blob/main/AGENTS.md) — it defines the required workflow for all webpack repos. 2. Read `scripts` in `package.json` — commands for testing, linting, formatting, and type generation differ across repos. Always use them, never run tools directly via `npx`. webpack-enhanced-resolve-7dfc9bc/CHANGELOG.md000066400000000000000000000327411523262174200207550ustar00rootroot00000000000000# enhanced-resolve ## 5.24.5 ### Patch Changes - Soft-fail when auto tsconfig discovery loads a broken config, and keep relative `extends` paths relative. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#645](https://github.com/webpack/enhanced-resolve/pull/645)) ## 5.24.4 ### Patch Changes - Keep the original request resolvable when `extensionAlias` lists its own extension. (by [@alexander-akait](https://github.com/alexander-akait) in [#641](https://github.com/webpack/enhanced-resolve/pull/641)) - Fix string `restrictions` boundary checks: a restriction ending with a separator no longer rejects everything inside it, restrictions are normalized before they are compared, and a Windows path now matches the way `path.win32` does, treating `/` and `\` as interchangeable and comparing case-insensitively, while `\` stays a filename character in a posix path. The same comparison backs `tsconfig` path matching. (by [@alexander-akait](https://github.com/alexander-akait) in [#643](https://github.com/webpack/enhanced-resolve/pull/643)) - Treat a UNC path (`\\server\share\…`) as a Windows path, so it normalizes, joins and walks up with `path.win32` semantics instead of being taken for a bare module request. (by [@alexander-akait](https://github.com/alexander-akait) in [#644](https://github.com/webpack/enhanced-resolve/pull/644)) ## 5.24.3 ### Patch Changes - Resolve tsconfig `extends` package specifiers from ancestor node_modules directories (workspace hoisting). (by [@alexander-akait](https://github.com/alexander-akait) in [#631](https://github.com/webpack/enhanced-resolve/pull/631)) ## 5.24.2 ### Patch Changes - Batch cached filesystem callbacks from one synchronous burst into a single tick. (by [@alexander-akait](https://github.com/alexander-akait) in [#623](https://github.com/webpack/enhanced-resolve/pull/623)) ## 5.24.1 ### Patch Changes - Reduce hot-path allocations in the resolve pipeline. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#615](https://github.com/webpack/enhanced-resolve/pull/615)) ## 5.24.0 ### Minor Changes - Allow the `context` path and `request` arguments of `resolve` (and `resolveSync`/`resolvePromise`) to accept `file:` `URL` instances, converting them to filesystem paths. Plain strings stay literal paths, matching Node's `fs`. (by [@alexander-akait](https://github.com/alexander-akait) in [#607](https://github.com/webpack/enhanced-resolve/pull/607)) ### Patch Changes - Make the resolver runtime-agnostic so it works in browsers, Deno and Bun as well as Node. File contents are decoded without assuming a Node `Buffer`, and browser shims are provided for the `path`, `url` and `graceful-fs` builtins (Node, Deno and Bun keep using the native ones) so the package bundles for the browser — supply your own `fileSystem` there. (by [@alexander-akait](https://github.com/alexander-akait) in [#606](https://github.com/webpack/enhanced-resolve/pull/606)) - Rename the positional `resolve`/`resolveSync`/`resolvePromise` parameters to `parent`/`specifier` (from `path`/`request`) for ESM-aligned naming and document them in the README. Purely cosmetic — arguments are positional, so there is no behavior or API change. (by [@alexander-akait](https://github.com/alexander-akait) in [#611](https://github.com/webpack/enhanced-resolve/pull/611)) ## 5.23.0 ### Minor Changes - Allow the path-like resolve options `roots`, `modules`, `alias`/`fallback` targets, `restrictions`, and `tsconfig` (the config file, `configFile`, `baseUrl`, and `references`) to accept file `URL` instances (such as `new URL("./dir/", import.meta.url)`), converting them to filesystem paths. Plain strings are still treated as literal paths, matching Node's `fs`. (by [@alexander-akait](https://github.com/alexander-akait) in [#604](https://github.com/webpack/enhanced-resolve/pull/604)) ## 5.22.2 ### Patch Changes - Fall back to the next `modules` entry when a package `exports` target is filtered out by `restrictions`, instead of throwing. (by [@alexander-akait](https://github.com/alexander-akait) in [#600](https://github.com/webpack/enhanced-resolve/pull/600)) ## 5.22.1 ### Patch Changes - Fix `restrictions` bypass via an in-root symlink pointing outside the root. (by [@alexander-akait](https://github.com/alexander-akait) in [#595](https://github.com/webpack/enhanced-resolve/pull/595)) ## 5.22.0 ### Minor Changes - `CachedInputFileSystem#purge` accepts a second `{ exact?: boolean }` argument; `exact: true` removes only entries whose key matches `what` exactly instead of any entry whose key starts with `what`. (by [@alexander-akait](https://github.com/alexander-akait) in [#591](https://github.com/webpack/enhanced-resolve/pull/591)) ## 5.21.6 ### Patch Changes - Speed up alias resolution on the hot path. (by [@alexander-akait](https://github.com/alexander-akait) in [#589](https://github.com/webpack/enhanced-resolve/pull/589)) - `AliasPlugin` / `TsconfigPathsPlugin`: bucket compiled alias options by the first char code of `name`, so resolves skip options whose name can't possibly match the request's first char. Gated to cases with 2+ distinct first chars so degenerate single-bucket lists (e.g. long alias chains) don't pay for the `Map.get`. - `TsconfigPathsPlugin`: memoize `_selectPathsDataForContext(map, requestPath)` per map so the per-source-file `contextList` scan only runs once per directory. Gated to maps with 2+ contexts so single-context tsconfigs aren't penalized by the cache lookup. Biggest wins on alias-heavy configs (300+ entries): `huge-alias-miss` +151%, `huge-alias-list` +126%, `alias-first-char-miss` +120%. ## 5.21.5 ### Patch Changes - Don't add configDir to modules when tsconfig has no baseUrl. (by [@alexander-akait](https://github.com/alexander-akait) in [`61f36fd`](https://github.com/webpack/enhanced-resolve/commit/61f36fd0bb7130a680fe747dc5e2d6589e3c9147)) ## 5.21.4 ### Patch Changes - When `tsconfig: true` is used, walk up parent directories to find `tsconfig.json`, matching TypeScript's own `findConfigFile` behavior. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#585](https://github.com/webpack/enhanced-resolve/pull/585)) ## 5.21.3 ### Patch Changes - TsconfigPathsPlugin now falls through to normal module resolution when a `paths` pattern matches but the mapped path does not exist, matching TypeScript's native resolution behavior. Previously, patterns like `"@*"` would block scoped npm packages (e.g. `@sentry/react`) from resolving via `node_modules`. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#579](https://github.com/webpack/enhanced-resolve/pull/579)) ## 5.21.2 ### Patch Changes - Fix TsconfigPathsPlugin circular project references causing stack overflow, add support for extending from unscoped npm packages, and use `stat` instead of `readFile` for existence checks in extends resolution. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#575](https://github.com/webpack/enhanced-resolve/pull/575)) - perf: dedupe miss paths in `DirectoryExistsPlugin`/`FileExistsPlugin` and prune the per-resolve `TsconfigPathsPlugin` context scan. (by [@alexander-akait](https://github.com/alexander-akait) in [#574](https://github.com/webpack/enhanced-resolve/pull/574)) - perf: drop a dead Map lookup in `findMatch` and flatten `AliasFieldPlugin`'s cache check. (by [@alexander-akait](https://github.com/alexander-akait) in [#574](https://github.com/webpack/enhanced-resolve/pull/574)) - perf: hot-path tweaks in `ImportsFieldPlugin`, `AliasUtils`, and `util/entrypoints`. (by [@alexander-akait](https://github.com/alexander-akait) in [#574](https://github.com/webpack/enhanced-resolve/pull/574)) - perf: cut per-resolve allocations in `Resolver.parse`, `loadDescriptionFile`, and `TsconfigPathsPlugin._selectPathsDataForContext`. (by [@alexander-akait](https://github.com/alexander-akait) in [#574](https://github.com/webpack/enhanced-resolve/pull/574)) ## 5.21.1 ### Patch Changes - Allocation-free reductions on hot-path code: hoist `/#/g`, `/\$/g` and `/\\/g` to module-level constants and gate the corresponding `.replace` calls behind `includes(…)` so paths/queries/requests without the match char skip the regex state machine entirely (the common case); share a single `EMPTY_NO_MATCH` tuple instead of allocating `[[], null]` per "no match" / "no condition matched" return; switch `directMapping`'s `for...of` over `mappingTarget` and inner results to indexed loops to avoid iterator-object allocation per call; inline `isConditionalMapping` at its two hot-path call sites and merge the duplicate `default` / `conditionNames.has(condition)` branches in `computeConditionalMapping`; replace `invalidSegmentRegEx.exec(…) !== null` with `.test(…)` (no match-array allocation); drop the dead `deprecatedInvalidSegmentRegEx.test(…) !== null` clause in `ImportsFieldPlugin` (`.test` returns boolean; `true !== null` and `false !== null` are both true, so it was `&& true`); drop the redundant `relativePath.length === 0` guard before `!startsWith("./")` in `ExportsFieldPlugin` (the empty-string case is already covered). (by [@alexander-akait](https://github.com/alexander-akait) in [#558](https://github.com/webpack/enhanced-resolve/pull/558)) - restore plugin compatibility for `[...resolveContext.stack]` iteration (by [@alexander-akait](https://github.com/alexander-akait) in [#569](https://github.com/webpack/enhanced-resolve/pull/569)) - fix `TsconfigPathsPlugin` to support `resolveSync` with `useSyncFileSystemCalls` (by [@alexander-akait](https://github.com/alexander-akait) in [#572](https://github.com/webpack/enhanced-resolve/pull/572)) ## 5.21.0 ### Minor Changes - Added promise API and support to resolve without `context` and `resolveContext`. (by [@alexander-akait](https://github.com/alexander-akait) in [#520](https://github.com/webpack/enhanced-resolve/pull/520)) - Add `extensionAliasForExports` option. When `true`, `extensionAlias` also applies to paths resolved through the `package.json` `exports` field. Off by default to match Node.js; opt in for full TypeScript-resolver parity with packages that ship `.ts` sources alongside the compiled `.js` they declare in `exports`. (by [@alexander-akait](https://github.com/alexander-akait) in [#554](https://github.com/webpack/enhanced-resolve/pull/554)) ### Patch Changes - Properly handle DOS device paths (`\\?\…` and `\\.\…`). (by [@alexander-akait](https://github.com/alexander-akait) in [#551](https://github.com/webpack/enhanced-resolve/pull/551)) - Prevent fallback to parent node_modules when the `exports` field target file is not found. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#495](https://github.com/webpack/enhanced-resolve/pull/495)) - Imports field spec deviation: non-relative targets (e.g. `"#a": "#b"`) no longer re-enter imports resolution, aligning with the Node.js ESM spec where `PACKAGE_IMPORTS_RESOLVE` does not recursively resolve `#` specifiers. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#503](https://github.com/webpack/enhanced-resolve/pull/503)) Previously `{ "#a": "#b", "#b": "./the.js" }` would chain-resolve `#a` to `./the.js`; now it correctly fails, matching Node.js behavior. - Move `cachedJoin`/`cachedDirname`/`createCachedBasename` caches from module-level globals to per-Resolver instances. This prevents unbounded memory growth in long-running processes — when a Resolver is garbage collected, its join/dirname/basename caches are released with it. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#507](https://github.com/webpack/enhanced-resolve/pull/507)) - Fixed when `tsconfig: true` is used (default config file) and no `tsconfig.json` exists. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#502](https://github.com/webpack/enhanced-resolve/pull/502)) - Apply the `extensionAlias` option to the `imports` field to be align with typescript resolution. (by [@alexander-akait](https://github.com/alexander-akait) in [#549](https://github.com/webpack/enhanced-resolve/pull/549)) - Improved performance of the many plugins. (by [@alexander-akait](https://github.com/alexander-akait) in [#529](https://github.com/webpack/enhanced-resolve/pull/529)) - Replace the `Set`-based resolver stack with a singly-linked `StackEntry` class that exposes a Set-compatible API. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#526](https://github.com/webpack/enhanced-resolve/pull/526)) Each `doResolve` call now prepends a single linked-list node instead of cloning the entire Set, making stack push O(1) in time and memory. Recursion detection walks the linked list (O(n)), but because the stack is typically shallow this is much cheaper than cloning a Set per call. - Cache the result of `stripJsonComments` + `JSON.parse` in `readJson` using a `WeakMap` keyed by the raw file buffer. This avoids redundant comment-stripping and JSON parsing on every resolve call that reads tsconfig.json files (via `stripComments: true`), improving TsconfigPathsPlugin warm performance by ~20-35% depending on the depth of the `extends` chain. (by [@xiaoxiaojx](https://github.com/xiaoxiaojx) in [#524](https://github.com/webpack/enhanced-resolve/pull/524)) - Avoid OOM in CachedInputFileSystem when duration is Infinity. (by [@alexander-akait](https://github.com/alexander-akait) in [#527](https://github.com/webpack/enhanced-resolve/pull/527)) ## 5.20.1 ### Patch Changes - Optimize `TsconfigPathsPlugin` and fix extends resolution bugs. (by [@alexander-akait](https://github.com/alexander-akait) in [#492](https://github.com/webpack/enhanced-resolve/pull/492)) - Improve resolver cache hit rate. (by [@alexander-akait](https://github.com/alexander-akait) in [#492](https://github.com/webpack/enhanced-resolve/pull/492)) webpack-enhanced-resolve-7dfc9bc/CLAUDE.md000077700000000000000000000000001523262174200217122AGENTS.mdustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/LICENSE000066400000000000000000000020571523262174200201460ustar00rootroot00000000000000Copyright JS Foundation and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. webpack-enhanced-resolve-7dfc9bc/README.md000066400000000000000000001703661523262174200204310ustar00rootroot00000000000000# enhanced-resolve [![npm][npm]][npm-url] [![Build Status][build-status]][build-status-url] [![codecov][codecov-badge]][codecov-url] [![Install Size][size]][size-url] [![GitHub Discussions][discussion]][discussion-url] Offers an async require.resolve function. It's highly configurable. ## Features - plugin system - provide a custom filesystem - sync and async node.js filesystems included ## Getting Started ### Install ```sh # npm npm install enhanced-resolve # or Yarn yarn add enhanced-resolve # or pnpm pnpm add enhanced-resolve ``` ### Resolve There is a Node.js API which allows to resolve requests according to the Node.js resolving rules. Sync, async (callback) and promise APIs are offered. A `create` method allows to create a custom resolve function. ```js const resolve = require("enhanced-resolve"); resolve("/some/path/to/folder", "module/dir", (err, result) => { result; // === "/some/path/node_modules/module/dir/index.js" }); resolve.sync("/some/path/to/folder", "../../dir"); // === "/some/path/dir/index.js" const result = await resolve.promise("/some/path/to/folder", "../../dir"); // === "/some/path/dir/index.js" const myResolve = resolve.create({ // or resolve.create.sync / resolve.create.promise extensions: [".ts", ".js"], // see more options below }); myResolve("/some/path/to/folder", "ts-module", (err, result) => { result; // === "/some/node_modules/ts-module/index.ts" }); ``` ### Public API All of the following are exposed from `require("enhanced-resolve")`. #### `resolve(context?, parent, specifier, resolveContext?, callback)` Async Node-style resolver using the built-in defaults (`conditionNames: ["node"]`, `extensions: [".js", ".json", ".node"]`). Both `context` and `resolveContext` are optional, so the function accepts four shapes: ```js resolve(context, parent, specifier, resolveContext, callback); resolve(context, parent, specifier, callback); resolve(parent, specifier, resolveContext, callback); resolve(parent, specifier, callback); // most common ``` The `parent` / `specifier` naming mirrors the ECMAScript resolution terms (as in `import.meta.resolve(specifier, parent)`): `parent` is the location you resolve **from**, and `specifier` is the string being resolved. ##### Arguments — what each one is and when to pass it | Argument | Required | What it is | When to pass it | | ---------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `context` | no | Extra info about _who_ is requesting, e.g. `{ environments: ["node+es3+es5+process+native"] }`. Plugins can read arbitrary keys off it. When omitted, a built-in Node context is used. | Pass it only when a plugin you use reads from it. Most callers omit it. | | `parent` | yes | The absolute directory to resolve **from** — the location the `specifier` is relative to (the ECMAScript "parent", historically called the "lookup start path"). | Always. | | `specifier` | yes | The string to resolve — a relative specifier (`./utils`), a bare module (`lodash/merge`), an alias, etc. (the ECMAScript "specifier", historically called the "request"). | Always. | | `resolveContext` | no | A collector object the resolver writes into / reads from: `fileDependencies`, `contextDependencies`, `missingDependencies` (`Set`s it fills in), `log` (a function it calls for trace output). | Pass it when you need to know which files/dirs were touched (e.g. to set up a watcher) or want a log of the resolution steps. | | `callback` | yes | `(err, result, resolveRequest) => void`. `result` is the resolved absolute path (or `false` if the request resolves to an ignored module). `resolveRequest` is the full request object with `path`, `query`, `fragment`, `descriptionFilePath`, etc. | Always. | ##### Minimal form — just `parent`, `specifier`, `callback` ```js const resolve = require("enhanced-resolve"); resolve(__dirname, "./utils", (err, result) => { if (err) throw err; result; // === "/abs/path/to/utils.js" }); ``` ##### Inspecting the full result via the third callback argument ```js resolve(__dirname, "./utils?query#frag", (err, result, resolveRequest) => { result; // === "/abs/path/to/utils.js?query#frag" — path with query/fragment appended resolveRequest.path; // === "/abs/path/to/utils.js" (the bare path, no query/fragment) resolveRequest.query; // === "?query" (empty string if the request has none) resolveRequest.fragment; // === "#frag" (empty string if the request has none) resolveRequest.descriptionFilePath; // path to the nearest package.json, if any }); ``` ##### With `resolveContext` — collect dependencies and a log Pass a `resolveContext` when you need the resolver to report back _what it looked at_. The `Set`s you provide are filled in during resolution, and `log` is called with each step: ```js const fileDependencies = new Set(); const missingDependencies = new Set(); const contextDependencies = new Set(); const logs = []; resolve( __dirname, "./utils", { fileDependencies, // files that were read/checked missingDependencies, // paths that were probed but didn't exist contextDependencies, // directories that were read log: (msg) => logs.push(msg), // trace of each resolution step }, (err, result) => { result; // === "/abs/path/to/utils.js" fileDependencies; // Set { ".../utils.js", ".../package.json", ... } missingDependencies; // Set { ".../utils", ".../utils.json", ... } (candidates tried) // `fileDependencies` / `missingDependencies` are exactly what you'd feed // a file watcher so a rebuild re-runs when any of them changes. }, ); ``` ##### With a custom `context` Pass a `context` when a plugin reads from it. The default resolver only uses `environments`, but custom plugins may key off anything you put here: ```js resolve( { environments: ["node+es3+es5+process+native"] }, // context __dirname, "./utils", (err, result) => { result; // === "/abs/path/to/utils.js" }, ); ``` #### `resolve.sync(context?, parent, specifier, resolveContext?) => string | false` Synchronous variant. Throws on failure, returns `false` when the resolve yields no result. ```js const file = resolve.sync(__dirname, "./utils"); ``` #### `resolve.promise(context?, parent, specifier, resolveContext?) => Promise` Promise variant of `resolve`. ```js const file = await resolve.promise(__dirname, "./utils"); ``` #### `resolve.create(options) => ResolveFunctionAsync` Builds a customized async resolve function. Options are the same as for [`ResolverFactory.createResolver`](#resolver-options); `fileSystem` defaults to the built-in Node.js filesystem. ```js const resolveTs = resolve.create({ extensions: [".ts", ".tsx", ".js"] }); resolveTs(__dirname, "./component", (err, result) => { // result === "/abs/path/to/component.tsx" }); ``` #### `resolve.create.sync(options) => ResolveFunction` Sync variant of `resolve.create`. ```js const resolveTsSync = resolve.create.sync({ extensions: [".ts", ".js"] }); const file = resolveTsSync(__dirname, "./component"); ``` #### `resolve.create.promise(options) => ResolveFunctionPromise` Promise variant of `resolve.create`. ```js const resolveTsPromise = resolve.create.promise({ extensions: [".ts", ".js"] }); const file = await resolveTsPromise(__dirname, "./component"); ``` #### `ResolverFactory.createResolver(options) => Resolver` Lower-level factory. Returns a `Resolver` whose `resolve`, `resolveSync`, and `resolvePromise` methods accept `(context, parent, specifier, resolveContext, [callback])`. Use this when you need a reusable resolver instance or access to its `hooks` (see the [Plugins](#plugins) section). `fileSystem` is required here — the high-level `resolve.create` defaults it for you. ```js const fs = require("fs"); const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json"], }); // callback resolver.resolve({}, __dirname, "./utils", {}, (err, file) => { // ... }); // sync (requires a sync fileSystem) const fileSync = resolver.resolveSync({}, __dirname, "./utils"); // promise const filePromise = await resolver.resolvePromise({}, __dirname, "./utils", {}); ``` #### `CachedInputFileSystem(fileSystem, duration)` Wraps any Node-compatible `fs` to add an in-memory cache for `stat`, `readdir`, `readFile`, `readJson`, and `readlink`. `duration` is the cache TTL in milliseconds (typically `4000`). Call `.purge()` to invalidate, or `.purge(path)` / `.purge([path, ...])` to invalidate specific entries — do this whenever you know files changed (e.g. from a watcher). ```js const fs = require("fs"); const { CachedInputFileSystem } = require("enhanced-resolve"); const cachedFs = new CachedInputFileSystem(fs, 4000); // later, when files change: cachedFs.purge("/abs/path/to/changed-file.js"); ``` #### Exported plugins & helpers For use with the `plugins` option or as standalone utilities: - `ResolverFactory` — see above. - `CachedInputFileSystem` — see above. - `CloneBasenamePlugin(source, target)` — joins the directory's basename onto the path. See [Built-in Plugins](#built-in-plugins). - `LogInfoPlugin(source)` — logs pipeline state at a hook; enable by passing a `log` function on the `resolveContext`. - `TsconfigPathsPlugin(options)` — applies `tsconfig.json` `paths` / `baseUrl` mappings; typically configured via the `tsconfig` resolver option instead. - `forEachBail(array, iterator, callback)` — bail-style async iterator used internally; useful when authoring plugins that try several candidates in order. ```js const { LogInfoPlugin } = require("enhanced-resolve"); const resolver = ResolverFactory.createResolver({ fileSystem: cachedFs, extensions: [".js"], plugins: [new LogInfoPlugin("described-resolve")], }); resolver.resolve( {}, __dirname, "./utils", { log: (msg) => console.log(msg) }, () => {}, ); ``` ### Creating a Resolver The easiest way to create a resolver is to use the `createResolver` function on `ResolveFactory`, along with one of the supplied File System implementations. ```js const fs = require("fs"); const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); // create a resolver const myResolver = ResolverFactory.createResolver({ // Typical usage will consume the `fs` + `CachedInputFileSystem`, which wraps Node.js `fs` to add caching. fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json"], /* any other resolver options here. Options/defaults can be seen below */ }); // resolve a file with the new resolver const context = {}; const parent = "/Users/webpack/some/root/dir"; // directory to resolve from const specifier = "./path/to-look-up.js"; // string to resolve const resolveContext = {}; // callback myResolver.resolve( context, parent, specifier, resolveContext, (err /* Error */, filepath /* string */) => { // Do something with the path }, ); // promise try { const filepath = await myResolver.resolvePromise( context, parent, specifier, resolveContext, ); // Do something with the path } catch (err) { // handle resolve failure } // sync (requires a sync fileSystem, e.g. the default Node.js one) const filepath = myResolver.resolveSync(context, parent, specifier); ``` #### Resolver Options | Field | Default | Description | | ------------------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | alias | [] | A list of module alias configurations or an object which maps key to value | | aliasFields | [] | A list of alias fields in description files | | extensionAlias | {} | An object which maps extension to extension aliases | | extensionAliasForExports | false | Also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default (Node.js-aligned) | | cachePredicate | function() { return true }; | A function which decides whether a request should be cached or not. An object is passed to the function with `path` and `request` properties. | | cacheWithContext | true | If unsafe cache is enabled, includes `request.context` in the cache key | | conditionNames | [] | A list of exports field condition names | | descriptionFiles | ["package.json"] | A list of description files to read from | | enforceExtension | false | Enforce that a extension from extensions must be used | | exportsFields | ["exports"] | A list of exports fields in description files | | extensions | [".js", ".json", ".node"] | A list of extensions which should be tried for files | | fallback | [] | Same as `alias`, but only used if default resolving fails | | fileSystem | | The file system which should be used | | fullySpecified | false | Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests) | | mainFields | ["main"] | A list of main fields in description files | | mainFiles | ["index"] | A list of main files in directories | | modules | ["node_modules"] | A list of directories to resolve modules from, can be absolute path or folder name | | plugins | [] | A list of additional resolve plugins which should be applied | | resolver | undefined | A prepared Resolver to which the plugins are attached | | resolveToContext | false | Resolve to a context instead of a file | | preferRelative | false | Prefer to resolve module requests as relative request and fallback to resolving as module | | preferAbsolute | false | Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots | | restrictions | [] | A list of resolve restrictions | | roots | [] | A list of root paths | | symlinks | true | Whether to resolve symlinks to their symlinked location | | tsconfig | false | TypeScript config for paths mapping. Can be `false` (disabled), `true` (use default `tsconfig.json`), a string path to `tsconfig.json`, or an object with `configFile`, `references`, and `baseUrl` options. Supports JSONC format (comments and trailing commas) like TypeScript compiler. | | tsconfig.configFile | tsconfig.json | Path to the tsconfig.json file | | tsconfig.references | [] | Project references. `'auto'` to load from tsconfig, or an array of paths to referenced projects | | tsconfig.baseUrl | undefined | Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file | | unsafeCache | false | Use this cache object to unsafely cache the successful requests | #### Option Examples Small snippets for the non-obvious options. All options are passed to `resolve.create({ ... })` or `ResolverFactory.createResolver({ ... })`. **`alias`** — rewrite matching requests to a target path, module, or to `false` to ignore them. Accepts an object or an array of entries (array form lets you specify ordering / `onlyModule`). ```js const options = { alias: { "@": path.resolve(__dirname, "src"), // @/utils → src/utils lodash$: "lodash-es", // exact "lodash", not "lodash/foo" "ignored-module": false, // short-circuit to an empty module }, }; ``` **`aliasFields`** — read alias maps from fields in `package.json`. The `browser` field is the common case: ```js const options = { aliasFields: ["browser"] }; ``` **`extensionAlias`** — maps one request extension to a list of candidate extensions. Useful for TypeScript ESM where imports are written with `.js` but the source is `.ts`. Applies both to direct requests (e.g. `./foo.js`) and to paths produced by the package.json `imports` field (e.g. `#foo` → `./foo.js` → `./foo.ts`). By default it does **not** apply to paths produced by the `exports` field (to stay aligned with Node.js, which does not substitute extensions on package-exported paths) — see `extensionAliasForExports` below to opt in: ```js const options = { extensionAlias: { ".js": [".ts", ".js"], ".mjs": [".mts", ".mjs"], }, }; ``` **`extensionAliasForExports`** — when `true`, also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default to match Node.js. Turn it on if you want full alignment with TypeScript's resolver for packages that ship `.ts` sources alongside the compiled `.js` files they list in `exports` (e.g. monorepo source packages, or the `eslint-import-resolver-typescript` use case): ```js const options = { extensionAlias: { ".js": [".ts", ".js"] }, extensionAliasForExports: true, }; ``` **`conditionNames` + `exportsFields`** — pick which conditions to match in the `exports` field of `package.json`: ```js const options = { conditionNames: ["import", "node", "default"], exportsFields: ["exports"], }; ``` **`extensions`** — extensions to try for extensionless requests, in order: ```js const options = { extensions: [".ts", ".tsx", ".js", ".json"] }; ``` **`fallback`** — same shape as `alias`, but only consulted when the primary resolve fails. Handy for polyfills: ```js const options = { fallback: { crypto: require.resolve("crypto-browserify"), stream: false, }, }; ``` **`modules`** — where to look for bare-module requests. Entries can be folder names (searched hierarchically up the tree) or absolute paths (searched directly): ```js const options = { modules: [path.resolve(__dirname, "src"), "node_modules"] }; ``` **`mainFields` / `mainFiles`** — fields in `package.json` to try for a package entry point, and filenames to try inside a directory: ```js const options = { mainFields: ["browser", "module", "main"], mainFiles: ["index"], }; ``` **`roots` + `preferAbsolute`** — resolve server-relative URLs (starting with `/`) against one or more root directories. With `preferAbsolute: true`, absolute-path resolution is tried before the roots are consulted. ```js const options = { roots: [path.resolve(__dirname, "public")], preferAbsolute: false, }; ``` **`restrictions`** — reject results that don't satisfy at least one restriction. Accepts strings (path prefixes) or `RegExp`s: ```js const options = { restrictions: [path.resolve(__dirname, "src"), /\.(js|ts)$/], }; ``` **`tsconfig`** — apply TypeScript `paths` / `baseUrl` mappings. Either pass `true` to load `./tsconfig.json`, a path string, or a configuration object: ```js const options = { tsconfig: { configFile: path.resolve(__dirname, "tsconfig.json"), references: "auto", // honor project references declared in tsconfig }, }; ``` **`symlinks`** — resolve to the real path by following symlinks. Set to `false` to keep the symlinked path (common for monorepo / pnpm layouts where you want module identity tied to the workspace location): ```js const options = { symlinks: false }; ``` **`fullySpecified`** — require fully-specified requests (no extension inference, no `index` lookup) for non-internal requests. Matches Node.js ESM semantics: ```js const options = { fullySpecified: true }; ``` **`unsafeCache`** — pass an object to use as an in-memory cache of successful resolves. Set to `true` to let the resolver allocate its own: ```js const options = { unsafeCache: {}, // or true cacheWithContext: false, // skip context in the cache key — faster, but only safe if context doesn't change the result }; ``` To observe whether a request was served from the cache, wrap the cache object in a `Proxy`. `UnsafeCachePlugin` reads entries with `cache[id]` (cache lookup) and writes them with `cache[id] = result` (cache store), so trapping `get` and `set` is enough to distinguish hits from misses: ```js const cache = {}; const observedCache = new Proxy(cache, { get(target, name, receiver) { const hit = name in target; console.log(hit ? `[cache hit] ${name}` : `[cache miss] ${name}`); return Reflect.get(target, name, receiver); }, set(target, name, value, receiver) { console.log(`[cache set] ${name}`); return Reflect.set(target, name, value, receiver); }, }); const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json"], unsafeCache: observedCache, }); ``` The `name` argument is the cache id — a `JSON.stringify`'d object containing `type`, `context`, `path`, `query`, `fragment`, and `request` — so you can parse it to report on specific resolves. Only successful resolves go through the cache; failures never touch it. **`fileSystem`** — any `fs`-compatible implementation. Usually `new CachedInputFileSystem(fs, 4000)`; can be a virtual filesystem (e.g. `memfs`) for testing: ```js const options = { fileSystem: new CachedInputFileSystem(require("fs"), 4000) }; ``` **`plugins`** — additional plugin instances appended to the pipeline. See [Plugins](#plugins): ```js const options = { plugins: [new TsconfigPathsPlugin({ configFile: "./tsconfig.json" })], }; ``` ## Plugins Similar to `webpack`, the core of `enhanced-resolve` functionality is implemented as individual plugins that are executed using [`tapable`](https://github.com/webpack/tapable). These plugins can extend the functionality of the library, adding other ways for files/contexts to be resolved. A plugin should be a `class` (or its ES5 equivalent) with an `apply` method. The `apply` method will receive a `resolver` instance, that can be used to hook in to the event system. Plugins are executed in a pipeline, and register which event they should be executed before/after. `source` is the name of the event that starts the pipeline, and `target` is what event this plugin should fire, which is what continues the execution of the pipeline. For a full view of how these plugin events form a chain, see `lib/ResolverFactory.js`, in the `//// pipeline ////` section. ### Built-in Plugins `enhanced-resolve` ships with the following plugins. Most of them are wired up automatically by `ResolverFactory` based on the [resolver options](#resolver-options); the ones exported from the package entry (`TsconfigPathsPlugin`, `CloneBasenamePlugin`, `LogInfoPlugin`) are the ones you're most likely to use explicitly. | Plugin | Purpose | | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `AliasPlugin` | Replaces a matching request with one or more alternative targets. Powers the `alias` and `fallback` options. | | `AliasFieldPlugin` | Applies aliasing based on a field in the description file (e.g. the `browser` field). Powers `aliasFields`. | | `AppendPlugin` | Appends a string (typically an extension) to the current path. Used for `extensions`. | | `CloneBasenamePlugin` | Joins the current directory basename onto the path (e.g. `/foo/bar` → `/foo/bar/bar`). Useful for directory-named main-file schemes. | | `ConditionalPlugin` | Forwards the request only when it matches a given partial request shape. | | `DescriptionFilePlugin` | Finds and loads the nearest description file (e.g. `package.json`) so other plugins can read its fields. Powers `descriptionFiles`. | | `DirectoryExistsPlugin` | Only continues the pipeline if the current path is an existing directory. | | `ExportsFieldPlugin` | Resolves requests through the `exports` field of a package's description file. Powers `exportsFields` and `conditionNames`. | | `ExtensionAliasPlugin` | Maps one extension to a list of alternative extensions (e.g. `.js` → `.ts`, `.js`). Powers `extensionAlias`. | | `FileExistsPlugin` | Only continues the pipeline if the current path is an existing file, and records the file as a dependency. | | `ImportsFieldPlugin` | Resolves `#name` requests through the `imports` field of the enclosing package. | | `JoinRequestPlugin` | Joins the current path with the current request into a new path. | | `JoinRequestPartPlugin` | Splits a module request into module name + inner request, joining the inner request onto the path. | | `LogInfoPlugin` | Emits verbose log output at a given pipeline step. Handy for debugging resolves via `resolveContext.log`. | | `MainFieldPlugin` | Uses a field in the description file (e.g. `main`) to point to the entry file of a package. Powers `mainFields`. | | `ModulesInHierarchicalDirectoriesPlugin` | Searches for a module by walking up parent directories (the standard `node_modules` lookup). Powers `modules`. | | `ModulesInRootPlugin` | Searches for a module in a single absolute directory. Powers absolute-path entries in `modules`. | | `NextPlugin` | Forwards the request from one hook to another without modification — glue between pipeline steps. | | `ParsePlugin` | Parses a raw request string into its components (path, query, fragment, module flag, etc.). | | `PnpPlugin` | Resolves module requests through a Yarn PnP API when one is available. | | `RestrictionsPlugin` | Rejects results that don't match a list of path restrictions (strings or regular expressions). Powers `restrictions`. | | `ResultPlugin` | Terminal plugin that fires the `result` hook — signals a successful resolve. | | `RootsPlugin` | Resolves server-relative URL requests (starting with `/`) against one or more root directories. Powers `roots`. | | `SelfReferencePlugin` | Resolves a package self-reference (e.g. `my-pkg/foo` from within `my-pkg`). | | `SymlinkPlugin` | Real paths the resolved file by following symlinks. Can be disabled via the `symlinks` option. | | `TryNextPlugin` | Forwards the request to the next hook with a log message. Useful for trying alternative resolutions. | | `TsconfigPathsPlugin` | Rewrites requests using the `paths` and `baseUrl` from a `tsconfig.json`. Powers the `tsconfig` option. | | `UnsafeCachePlugin` | Caches successful resolves in an in-memory map to speed up repeated requests. Powers `unsafeCache`. | | `UseFilePlugin` | Joins a fixed filename onto the current path (e.g. `index`). Powers `mainFiles`. | #### Plugin wiring and goals One-line goal and default wiring (`source → target`) for each plugin. `*` means the plugin is tapped on several hooks — the common ones are listed. Plugins without a fixed wiring are user-tapped. - **`AliasPlugin`** — Goal: redirect requests matching a configured key to an alternative target. `raw-resolve` → `internal-resolve` for `alias`; `file` → `internal-resolve` as a last-chance remap; `described-resolve` → `internal-resolve` for `fallback`. - **`AliasFieldPlugin`** — Goal: apply aliases declared in a description-file field like `browser`, so environment-specific substitutions happen without user config. `raw-resolve` / `file` → `internal-resolve`. - **`AppendPlugin`** — Goal: try appending a fixed string (usually an extension) to the current path. `raw-file` → `file`, one instance per entry in `extensions`. - **`CloneBasenamePlugin`** — Goal: join the directory's basename onto the path (e.g. `/foo/bar` → `/foo/bar/bar`) for directory-named-main layouts. User-wired via `plugins`. - **`ConditionalPlugin`** — Goal: gate a forward on a partial match of the request shape (e.g. `{ module: true }`), used to fan-out at branching hooks. Tapped on `after-normal-resolve`, `resolve-as-module`, `described-relative`, and `raw-file`. - **`DescriptionFilePlugin`** — Goal: locate and attach the nearest description file (usually `package.json`) so downstream plugins can read its fields. `parsed-resolve` → `described-resolve`, `relative` → `described-relative`, `undescribed-resolve-in-package` → `resolve-in-package`, `undescribed-existing-directory` → `existing-directory`, `undescribed-raw-file` → `raw-file`. - **`DirectoryExistsPlugin`** — Goal: only continue the pipeline if the current path exists as a directory. `resolve-as-module` → `undescribed-resolve-in-package`, `directory` → `undescribed-existing-directory`. - **`ExportsFieldPlugin`** — Goal: map a request through the `exports` field of a package's description file (with `conditionNames`). `resolve-in-package` → `relative`. - **`ExtensionAliasPlugin`** — Goal: rewrite a request's extension to a list of candidate extensions (e.g. `.js` → `.ts`, `.js`) for TypeScript ESM and similar. `raw-resolve` → `normal-resolve` for direct requests; also `imports-field-relative` → `relative` so extension substitution applies to `imports`-field targets. - **`FileExistsPlugin`** — Goal: confirm a candidate path exists as a file and record it as a file dependency. `final-file` → `existing-file`. - **`ImportsFieldPlugin`** — Goal: resolve `#name` requests through the `imports` field of the enclosing package. `internal` → `imports-field-relative` (relative target) or `imports-resolve` (bare target). - **`JoinRequestPlugin`** — Goal: join the current path with the current request into a single concrete path. `after-normal-resolve` → `relative` (three stage-offset copies for `preferRelative`, `preferAbsolute`, and default), `resolve-in-existing-directory` → `relative`. - **`JoinRequestPartPlugin`** — Goal: split a module request into module name + inner request, joining the inner part onto the path. `module` → `resolve-as-module`. - **`LogInfoPlugin`** — Goal: emit verbose log output at a chosen hook; enable by passing a `log` function on `resolveContext`. User-wired via `plugins`. - **`MainFieldPlugin`** — Goal: follow a description-file field (e.g. `main`, `module`, `browser`) to the entry file of a package. `existing-directory` → `resolve-in-existing-directory`, one instance per entry in `mainFields`. - **`ModulesInHierarchicalDirectoriesPlugin`** — Goal: search for a module by walking up parent directories (the standard `node_modules` lookup). `raw-module` → `module`; when PnP is enabled, `alternate-raw-module` → `module` too. - **`ModulesInRootPlugin`** — Goal: search for a module in a single absolute directory (powers absolute-path entries in `modules`). `raw-module` → `module`. - **`NextPlugin`** — Goal: glue — forward the current request unchanged from one hook to another. Used across the pipeline wherever two hooks should run sequentially. - **`ParsePlugin`** — Goal: split the raw request string into path / query / fragment / `module` / `directory` / `internal` flags. `resolve` → `parsed-resolve`; also wired on `internal-resolve` and `imports-resolve`. - **`PnpPlugin`** — Goal: resolve bare-module requests through Yarn's PnP API when available. `raw-module` → `undescribed-resolve-in-package` on hit, `alternate-raw-module` on miss. - **`RestrictionsPlugin`** — Goal: reject resolved paths that don't satisfy at least one string prefix or RegExp. Tapped on `resolved`. - **`ResultPlugin`** — Goal: terminal plugin — fires the `result` lifecycle hook and signals a successful resolve. Tapped on `resolved`. - **`RootsPlugin`** — Goal: resolve server-relative URL requests (starting with `/`) against one or more root directories. `after-normal-resolve` → `relative`. - **`SelfReferencePlugin`** — Goal: resolve a package self-reference (`my-pkg/foo` from inside `my-pkg`) via its own `exports`. `raw-module` → `resolve-as-module`. - **`SymlinkPlugin`** — Goal: real-path the resolved file by following symlinks; can be disabled via `symlinks: false`. `existing-file` → `existing-file` (runs via a stage offset on the same hook). - **`TryNextPlugin`** — Goal: forward the request to another hook with a log message, useful for trying an alternative candidate. `raw-file` → `file` (as the "no extension" attempt) and user-wired. - **`TsconfigPathsPlugin`** — Goal: rewrite requests using the `paths` and `baseUrl` from a `tsconfig.json` (including project references). Taps `described-resolve` internally and forwards to `internal-resolve`; exported for direct use as well. - **`UnsafeCachePlugin`** — Goal: cache successful resolves in an in-memory map for repeated requests. `described-resolve` → `raw-resolve` (only when `unsafeCache` is enabled). - **`UseFilePlugin`** — Goal: join a fixed filename (e.g. `index`) onto the current path to try as an entry file. `existing-directory` / `undescribed-existing-directory` → `undescribed-raw-file`, one instance per entry in `mainFiles`. ### Hooks A resolver exposes two kinds of [`tapable`](https://github.com/webpack/tapable) hooks: - **Lifecycle hooks** on `resolver.hooks` — fired by the resolver itself around each `resolve` call. Use these to observe, not to transform the request. - **Pipeline hooks** — the named steps that plugins tap as `source` and forward to as `target`. Every pipeline hook is an `AsyncSeriesBailHook<[request, resolveContext], request | null>`: return `callback()` to pass on, `callback(err)` to fail, or `callback(null, request)` to short-circuit with a result. Obtain them with `resolver.ensureHook(name)` (creates if missing) or `resolver.getHook(name)` (throws if missing); names are kebab-case or camelCase and are interchangeable. #### Lifecycle hooks | Hook | Type | Fires when | | ------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `resolveStep` | `SyncHook` | Every time the resolver hands a request to a pipeline hook. Arguments: `(hook, request)`. Ideal for tracing. | | `noResolve` | `SyncHook` | When a top-level `resolve()` call can't produce a result. Arguments: `(request, error)`. | | `resolve` | `AsyncSeriesBailHook` | Entry point of the pipeline (also listed below). Tap this to intercept requests before parsing. | | `result` | `AsyncSeriesHook` | After a successful resolve, with the final request. Fired by `ResultPlugin`. Tap to observe/record results without short-circuiting. | #### Pipeline hooks Listed roughly in the order the default pipeline visits them. Full wiring lives in `lib/ResolverFactory.js` under `//// pipeline ////`. | Hook | Role | | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `resolve` | Entry point. `ParsePlugin` parses the raw request (path, query, fragment, module flag) and forwards to `parsed-resolve`. | | `internal-resolve` | Re-entry point used by internal rewrites (e.g. after an `alias` fires). Same role as `resolve`, but `fullySpecified` is forced off. | | `imports-resolve` | Re-entry point for the target of an `imports` field match; prevents recursive `#` resolution per the Node.js ESM spec. | | `parsed-resolve` | Request has been parsed. `DescriptionFilePlugin` attaches the nearest `package.json`, then forwards to `described-resolve`. | | `described-resolve` | Description file is attached. Where `unsafeCache`, `fallback`, and most user plugins (including `MyLibSrcPlugin` below) hook in. | | `raw-resolve` | After description. Where `alias`, `aliasFields`, `tsconfig` paths, and `extensionAlias` rewrites fire before default resolution. | | `normal-resolve` | Default resolution starts. Branches into `relative` (for `./`, `../`, absolute), `raw-module` (bare modules), or `internal` (`#imports`). | | `internal` | `#name` imports-field entry. `ImportsFieldPlugin` maps the specifier and forwards to `imports-field-relative` or `imports-resolve`. | | `imports-field-relative` | Concrete path from an `imports`-field match, before the normal `relative` flow. `ExtensionAliasPlugin` taps here so `.js` → `.ts` also fires for `#name` targets. Forwards to `relative`. | | `raw-module` | Bare-module lookup. `SelfReferencePlugin`, `ModulesInHierarchicalDirectoriesPlugin`, `ModulesInRootPlugin`, and `PnpPlugin` all tap here. | | `alternate-raw-module` | Fallback module lookup used by `PnpPlugin` when PnP can't resolve and `node_modules` should be tried. | | `module` | A candidate module directory was built. `JoinRequestPartPlugin` splits off the inner request and forwards to `resolve-as-module`. | | `resolve-as-module` | Treat candidate as a package. `DirectoryExistsPlugin` gates on existence; short single-file modules may re-enter via `undescribed-raw-file`. | | `undescribed-resolve-in-package` | Inside a located package directory, before its `package.json` has been read. Loads the description, forwards to `resolve-in-package`. | | `resolve-in-package` | Inside a package with its description loaded. `ExportsFieldPlugin` matches `exports`, otherwise forwards to `resolve-in-existing-directory`. | | `resolve-in-existing-directory` | Package directory confirmed; join the remaining request onto it and continue at `relative`. | | `relative` | A concrete path on disk. `DescriptionFilePlugin` loads the nearest `package.json` and forwards to `described-relative`. | | `described-relative` | Branches to `raw-file` (treat as file) and `directory` (treat as directory). `resolveToContext` skips the file branch. | | `directory` | Candidate directory. `DirectoryExistsPlugin` gates on existence and forwards to `undescribed-existing-directory`. | | `undescribed-existing-directory` | Existing directory, before its `package.json` has been read. `UseFilePlugin` tries `mainFiles` via `undescribed-raw-file`. | | `existing-directory` | Existing directory with description loaded. `MainFieldPlugin` tries `mainFields`; `UseFilePlugin` falls back to `mainFiles`. | | `undescribed-raw-file` | Candidate file path, before description is read. Loads description, then forwards to `raw-file`. | | `raw-file` | Apply extension handling: `ConditionalPlugin` short-circuits when `fullySpecified`, `TryNextPlugin` + `AppendPlugin` try each extension. | | `file` | A specific file path. Last place `alias` and `aliasFields` can redirect; forwards to `final-file`. | | `final-file` | `FileExistsPlugin` checks the file is real and records it as a file dependency, then forwards to `existing-file`. | | `existing-file` | Real file on disk. `SymlinkPlugin` real-paths symlinks (unless `symlinks: false`), then forwards to `resolved`. | | `resolved` | Terminal hook. `RestrictionsPlugin` enforces `restrictions`; `ResultPlugin` fires the `result` lifecycle hook. | #### `before-` and `after-` prefixes `ensureHook("before-foo")` and `getHook("before-foo")` return the `foo` hook with `stage: -10`; `after-foo` returns it with `stage: 10`. Use this to tap earlier or later than the default stage without creating a separate hook. You'll see `after-parsed-resolve`, `after-normal-resolve`, `after-relative`, and `after-undescribed-resolve-in-package` used this way inside `ResolverFactory`. #### Request flow by request type The same 26 pipeline hooks serve every request, but different request shapes take different paths through them. Each `➝` below is one `doResolve` / `NextPlugin` / plugin forward; `resolveStep` fires on every arrow, so tapping it (see [Hook examples](#hook-examples)) prints these chains live. Relative path (`./utils` from `/src/index.js`) — the default "resolve on disk" path: ```text resolve (ParsePlugin) ➝ parsed-resolve (DescriptionFilePlugin attaches nearest package.json) ➝ described-resolve (NextPlugin; or UnsafeCachePlugin short-circuit) ➝ raw-resolve (NextPlugin; alias/tsconfig would branch here) ➝ normal-resolve (JoinRequestPlugin: path=/src/utils, request="") ➝ relative (DescriptionFilePlugin loads /src/package.json) ➝ described-relative (branches to file and directory candidates) ├─ ➝ raw-file (ConditionalPlugin / TryNextPlugin) │ ➝ file (AppendPlugin tried each extension, e.g. .js) │ ➝ final-file (FileExistsPlugin confirms the file) │ ➝ existing-file (SymlinkPlugin real-paths it) │ ➝ resolved (RestrictionsPlugin → ResultPlugin) └─ ➝ directory (DirectoryExistsPlugin; used when path is a dir) ➝ undescribed-existing-directory ➝ existing-directory (MainFieldPlugin tries "main", UseFilePlugin tries "index") ➝ undescribed-raw-file ➝ raw-file ➝ … ``` Bare module (`lodash/merge`) — walks up `node_modules`, then treats the hit as a package: ```text resolve ➝ parsed-resolve ➝ described-resolve ➝ raw-resolve ➝ normal-resolve ➝ raw-module (ConditionalPlugin {module:true}) ➝ module (ModulesInHierarchicalDirectoriesPlugin walks /src/node_modules, /node_modules, …) ➝ resolve-as-module (JoinRequestPartPlugin splits "lodash" / "./merge") ➝ undescribed-resolve-in-package (DirectoryExistsPlugin gates on lodash/ existing) ➝ resolve-in-package (DescriptionFilePlugin loads lodash/package.json) ├─ ➝ relative (ExportsFieldPlugin, if "exports" matches) └─ ➝ resolve-in-existing-directory (otherwise; JoinRequestPlugin joins "./merge") ➝ relative ➝ … (same tail as the relative flow above) ``` Internal import (`#util` from inside a package) — re-enters the pipeline after mapping: ```text resolve ➝ parsed-resolve ➝ described-resolve ➝ raw-resolve ➝ normal-resolve ➝ internal (ConditionalPlugin {internal:true}) ➝ imports-resolve (ImportsFieldPlugin mapped "#util" to a bare target) ➝ parsed-resolve ➝ … (fresh pipeline run, internal:false so # isn't remapped) ``` When the `imports` field maps to a relative target, the branch instead goes: ```text ➝ internal ➝ imports-field-relative (ImportsFieldPlugin mapped "#util" to "./util.js"; ExtensionAliasPlugin can swap .js → .ts here) ➝ relative ➝ … (same tail as the relative flow above) ``` Alias hit (`@/button` with `alias: { "@": "/src" }`) — rewrites then restarts: ```text resolve ➝ parsed-resolve ➝ described-resolve ➝ raw-resolve ➝ internal-resolve (AliasPlugin rewrote request → "/src/button") ➝ parsed-resolve ➝ … (fullySpecified forced off; AliasPlugin won't re-fire for the rewritten form) ``` `exports`-field hit inside a package (`pkg/feature` matching `"./feature"` in `exports`): ```text … ➝ raw-module ➝ module ➝ resolve-as-module ➝ undescribed-resolve-in-package ➝ resolve-in-package ➝ relative (ExportsFieldPlugin jumped to the exports target; main-field / main-file logic is skipped) ➝ described-relative ➝ raw-file ➝ file ➝ final-file ➝ existing-file ➝ resolved ``` Failure — every candidate opts out (`callback()`) and no handler ever short-circuits with a result. `noResolve` fires once, for the top-level request: ```text … ➝ final-file ✗ FileExistsPlugin: ENOENT (opts out; no extension candidates left) ⇠ bail hooks unwind, each tapped handler has already tried its alternatives ⇒ top-level resolve() returns no result ⇒ resolver.hooks.noResolve(request, error) (ResultPlugin never fires) ``` #### Hook examples Trace every pipeline step and observe failures via the lifecycle hooks: ```js resolver.hooks.resolveStep.tap("Trace", (hook, request) => { console.log(`[step] ${hook.name}: ${request.request} @ ${request.path}`); }); resolver.hooks.noResolve.tap("Trace", (request, error) => { console.log(`[fail] ${request.request}: ${error.message}`); }); resolver.hooks.result.tapAsync("Trace", (request, _ctx, callback) => { console.log(`[done] ${request.path}`); callback(); }); ``` Short-circuit at `file` to redirect any `.css` request to a stub without continuing the pipeline: ```js class StubCssPlugin { apply(resolver) { resolver .getHook("file") .tapAsync("StubCssPlugin", (request, _ctx, callback) => { if (!request.path || !request.path.endsWith(".css")) return callback(); callback(null, { ...request, path: require.resolve("./empty.css") }); }); } } ``` Forward to a different hook with `doResolve` to restart resolution with a rewritten request — see `MyLibSrcPlugin` in [Writing a Custom Plugin](#writing-a-custom-plugin) for the canonical pattern (`getHook("described-resolve")` → `doResolve(ensureHook("resolve"), …)`). ### Writing a Custom Plugin The example below adds a plugin that rewrites any request starting with `my-lib/` to `my-lib/src/`. It taps the `described-resolve` hook (after the description file has been located) and forwards the rewritten request to `resolve`, so the pipeline restarts with the new request. ```js const fs = require("fs"); const { CachedInputFileSystem, ResolverFactory } = require("enhanced-resolve"); class MyLibSrcPlugin { apply(resolver) { const target = resolver.ensureHook("resolve"); resolver .getHook("described-resolve") .tapAsync("MyLibSrcPlugin", (request, resolveContext, callback) => { if (!request.request || !request.request.startsWith("my-lib/")) { return callback(); } const newRequest = { ...request, request: request.request.replace(/^my-lib\//, "my-lib/src/"), }; resolver.doResolve( target, newRequest, "rewrote my-lib → my-lib/src", resolveContext, callback, ); }); } } const myResolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json"], plugins: [new MyLibSrcPlugin()], }); ``` Tips for writing your own plugin: - Call `callback()` with no arguments to pass the request on to the next tapped handler at the same `source` hook. This is how you "opt out" when a request doesn't apply. - Call `resolver.doResolve(target, newRequest, message, resolveContext, callback)` to continue the pipeline at a different hook with a (possibly modified) request. - Return early with `callback(null, result)` to short-circuit with a specific result, or `callback(err)` to fail the resolve. - See [Hooks](#hooks) for the full list of pipeline hooks, their order, and the `before-` / `after-` stage modifiers. `lib/ResolverFactory.js` has the exact wiring under `//// pipeline ////`. ## Escaping It's allowed to escape `#` as `\0#` to avoid parsing it as fragment. enhanced-resolve will try to resolve requests containing `#` as path and as fragment, so it will automatically figure out if `./some#thing` means `.../some.js#thing` or `.../some#thing.js`. When a `#` is resolved as path it will be escaped in the result. Here: `.../some\0#thing.js`. ## Tests ```sh npm run test ``` ## Passing options from webpack If you are using `webpack`, and you want to pass custom options to `enhanced-resolve`, the options are passed from the `resolve` key of your webpack configuration e.g.: ``` resolve: { extensions: ['.js', '.jsx'], modules: [path.resolve(__dirname, 'src'), 'node_modules'], plugins: [new DirectoryNamedWebpackPlugin()] ... }, ``` ## License Copyright (c) 2012-2019 JS Foundation and other contributors MIT (http://www.opensource.org/licenses/mit-license.php) [npm]: https://img.shields.io/npm/v/enhanced-resolve.svg [npm-url]: https://www.npmjs.com/package/enhanced-resolve [build-status]: https://github.com/webpack/enhanced-resolve/actions/workflows/test.yml/badge.svg [build-status-url]: https://github.com/webpack/enhanced-resolve/actions [codecov-badge]: https://codecov.io/gh/webpack/enhanced-resolve/branch/main/graph/badge.svg?token=6B6NxtsZc3 [codecov-url]: https://codecov.io/gh/webpack/enhanced-resolve [size]: https://packagephobia.com/badge?p=enhanced-resolve [size-url]: https://packagephobia.com/result?p=enhanced-resolve [discussion]: https://img.shields.io/github/discussions/webpack/webpack [discussion-url]: https://github.com/webpack/webpack/discussions webpack-enhanced-resolve-7dfc9bc/benchmark/000077500000000000000000000000001523262174200210675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/README.md000066400000000000000000000277641523262174200223660ustar00rootroot00000000000000# Benchmarks Performance benchmarks for `enhanced-resolve`, tracked over time via [CodSpeed](https://codspeed.io/). Runner stack: [tinybench](https://github.com/tinylibs/tinybench) + [`@codspeed/core`](https://www.npmjs.com/package/@codspeed/core) with a local `withCodSpeed()` wrapper ported from webpack's `test/BenchmarkTestCases.benchmark.mjs`. Locally it falls back to plain tinybench wall-clock measurements, and under `CodSpeedHQ/action` in CI it automatically switches to CodSpeed's instrumentation mode. ## Running locally ```sh npm run benchmark ``` Optional substring filter to run only matching cases: ```sh npm run benchmark -- realistic BENCH_FILTER=pathological npm run benchmark ``` Locally the runner uses tinybench's wall-clock measurements and prints a table of ops/s, mean, p99, and relative margin of error per task. Under CI, the plugin detects the CodSpeed runner environment and switches to instruction-counting (`simulation`) or heap-allocation (`memory`) mode automatically, depending on which CI job invoked it. The V8 flags in `package.json` (`--no-opt --predictable --hash-seed=1` etc.) are required by CodSpeed's instrumentation mode for deterministic results — do not drop them. ### Optional: running real instruction counts locally If you want to reproduce CI's exact instrument-count numbers on your own machine (Linux only — the underlying Valgrind tooling has no macOS backend), install the standalone CodSpeed CLI and wrap `npm run benchmark` with it: ```sh curl -fsSL https://codspeed.io/install.sh | bash codspeed run npm run benchmark ``` This is only useful if you want to debug an instruction-count regression outside CI. Day-to-day benchmark iteration should use `npm run benchmark` directly (wall-clock mode). ## Layout ``` benchmark/ ├── run.mjs # entry point: discovers cases, runs bench └── cases/ └── / ├── index.bench.mjs # default export: register(bench, ctx) └── fixture/ # optional: project tree to resolve against ``` Each case directory must contain `index.bench.mjs` exporting a default function with the signature: ```js export default function register(bench, { caseName, caseDir, fixtureDir }) { bench.add("my case: descriptive name", async () => { // ... resolve calls ... }); } ``` `fixtureDir` is the absolute path to the case's `fixture/` subdirectory (which may or may not exist). `caseDir` is the parent directory containing `index.bench.mjs`. ## Existing cases | Case | What it measures | | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | `realistic-midsize` | Mixed batch of relative/bare/scoped/exports/nested-`node_modules` requests against a synthetic mid-size tree | | `pathological-deep-stack` | 50-deep alias chain, specifically stresses the `doResolve` recursion-check path | | `stack-churn` | Several independent depth-60 alias chains — stresses `doResolve`'s per-level stack-allocation pressure | | `alias-realistic` | Webpack-style `@/components`, `@utils`, `~` aliases — AliasPlugin with a realistic number of entries | | `alias-field` | `browser` field remapping (AliasFieldPlugin), including the `false`/ignored branch | | `exports-field` | Package with nested condition maps and wildcard subpath exports, run under both `require` and `import` | | `imports-field` | Package-internal `#foo` imports with conditionals and patterns | | `extension-alias` | `.js` → `.ts` TypeScript-style extension remapping | | `extensions-many` | Six-extension trial list (`.ts`, `.tsx`, `.mjs`, `.js`, `.jsx`, `.json`), hitting each position | | `fully-specified` | ESM-style `fullySpecified: true` resolution where extensions are mandatory | | `tsconfig-paths` | TsconfigPathsPlugin with five wildcard path prefixes and a plain-string fallback | | `roots` | RootsPlugin: server-relative (`/…`) requests against a configured root | | `restrictions` | RestrictionsPlugin: path prefix + regex restriction checked on every successful resolve | | `fallback` | `fallback` aliases (common Node-built-in polyfill pattern) | | `self-reference` | SelfReferencePlugin: a package imports itself via its own package name and `exports` map | | `unsafe-cache` | UnsafeCachePlugin on vs off, with three passes over the same request list per iteration | | `unsafe-cache-miss-heavy` | UnsafeCachePlugin with a 42-request batch run miss-pass + hit-pass, stresses the cache-id hot path | | `deep-hierarchy` | Bare + relative resolution from 10 directory levels deep (walks `ModulesInHierarchicalDirectoriesPlugin`) | | `prefer-relative` | `preferRelative: true` — bare specifiers attempted as relative before node_modules | | `main-field` | MainFieldPlugin with `browser`/`module`/`main` candidates against packages defining different combinations | | `sync-resolver` | `useSyncFileSystemCalls: true` via `resolveSync` — the loader-resolver hot path | | `symlinks` | SymlinkPlugin on vs off, resolves routed through symlink targets created at bench setup | | `resolve-to-context` | `resolveToContext: true` directory-only branch of the resolver pipeline | | `failed-resolution` | Error path: missing files and packages, walks the full pipeline before reporting the miss | | `concurrent-batch` | 15 resolves through `Promise.all`, exercising in-flight request de-duplication | | `large-alias-list` | 50 non-matching + 8 matching aliases, stresses AliasPlugin's linear scan | | `huge-alias-list` | 300 non-matching + 8 matching aliases, match near end — monorepo-scale AliasPlugin scan | | `huge-alias-miss` | 300 aliases + requests that never match any — pure per-option overhead, no `doResolve` recursion | | `multiple-modules` | `modules: [shared, vendor, node_modules]` mix of root + hierarchical directories | | `mixed-conditions` | Nested condition map (browser/worker/node/development/production/...) under 4 condition configurations | | `exports-patterns-many` | Package with 6 wildcard subpath exports × 4 leaves per prefix — pattern-matcher stress | | `tsconfig-extends` | 3-level tsconfig `extends` chain merged into `paths` | | `enforce-extension` | `enforceExtension: true`, explicit `.js` requests — tighter pipeline than the default | | `deep-package-subpath` | `pkg/a`, `pkg/a/b`, `pkg/a/b/c` requests into a single package (lodash/fp style) | | `query-fragment` | `?query` and `#fragment` suffixes, exercises ParsePlugin's split/rejoin on the result | | `prefer-absolute` | `preferAbsolute: true` with absolute paths — different normal-resolve branch than `preferRelative` | | `cache-predicate` | `unsafeCache: true` + custom `cachePredicate` filtering which results actually cache | | `extension-alias-many` | `extensionAlias` with 3 source extensions each mapping to a list of candidates | | `array-alias` | AliasPlugin with an array alias value (`{ alias: [preferred, fallback] }`) | | `main-files` | Custom `mainFiles: ["main", "entry", "index"]` walked by UseFilePlugin | | `description-files-multi` | `descriptionFiles: [package.json, bower.json, component.json]` walked per directory | | `many-extensions-miss` | Worst-case extension probing: 5 misses + 1 hit per resolve for a 6-extension list | | `alias-wildcard-scan` | Scan of 100 aliases where one is a wildcard (`pkg-*`) — isolates AliasUtils per-item wildcard-detection cost | | `get-paths` | Micro-bench: `lib/getPaths.js` over a mix of POSIX, Windows, and bare inputs (drives `ModulesInHierarchicalDirectoriesPlugin`) | | `get-inner-request` | Micro-bench: `lib/getInnerRequest.js` cold + memoized hot paths (called from most resolve-step plugins) | | `cd-up` | Micro-bench: `DescriptionFileUtils.cdUp` single-level calls + walk-to-root (drives `loadDescriptionFile` ancestor walk) | | `unsafe-cache-key-build` | Stress for `UnsafeCachePlugin.getCacheId` over 48 distinct requests with query/fragment variants (3-pass cached) | | `modules-flat-addrs` | 8-deep src dir × 4-entry `modules` list — exercises the flat addr build inside `ModulesUtils.modulesResolveHandler` | Add new cases by creating a new directory under `cases/` — `run.mjs` will pick it up automatically on the next run. ## Adding a CodSpeed-friendly case A few rules of thumb: 1. **Keep each bench body long enough to be measurable** (batch many resolves per iteration). CodSpeed's simulation mode runs the body exactly once under instrumentation, so a body that does one `resolver.resolve()` will be dominated by instrumentation overhead. 2. **Avoid randomness.** Fixed request lists, fixed seeds. CodSpeed compares against the base commit and expects identical work across runs. 3. **Pre-build anything expensive (resolvers, alias lists, fixture paths) outside the `bench.add` callback.** The goal is to measure resolve, not setup. 4. **Prefer one focused case per bench file**, so the PR report is easy to read. ## CI integration CI is driven by `.github/workflows/benchmarks.yml`, which uses `CodSpeedHQ/action@v4` to run the same `npm run benchmark` entry point under two modes via a matrix: - `simulation` — CPU / instruction-count measurements (the standard CodSpeed performance benchmark). - `memory` — heap-allocation measurements via the same instrumentation hooks (`InstrumentHooks.startBenchmark` / `stopBenchmark`); the CodSpeed runner collects allocation stats between those markers instead of instructions. Both jobs share the same bench cases — `benchmark/with-codspeed.mjs` routes both modes through the identical instrumented code path, so there is nothing per-case to add for memory tracking. Authentication is via the `CODSPEED_TOKEN` repo secret. Both `CODSPEED_TOKEN` and CodSpeed repo enablement must be configured by a repo admin once — see the top-level PR description for the handoff. webpack-enhanced-resolve-7dfc9bc/benchmark/cases/000077500000000000000000000000001523262174200221655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/000077500000000000000000000000001523262174200243375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/000077500000000000000000000000001523262174200260255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/package.json000066400000000000000000000004161523262174200303140ustar00rootroot00000000000000{ "name": "alias-field-fixture", "version": "1.0.0", "browser": { "./src/server.js": "./src/browser.js", "./src/node-only.js": false, "./src/fs-shim.js": "./src/fs-browser.js", "fs": "./src/fs-browser.js", "path": "./src/path-browser.js" } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/000077500000000000000000000000001523262174200266145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/browser.js000066400000000000000000000000251523262174200306320ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/fs-browser.js000066400000000000000000000000251523262174200312400ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/fs-shim.js000066400000000000000000000000251523262174200305150ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/index.js000066400000000000000000000000251523262174200302560ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/path-browser.js000066400000000000000000000000251523262174200315640ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/safe.js000066400000000000000000000000251523262174200300650ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/fixture/src/server.js000066400000000000000000000000251523262174200304550ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-field/index.bench.mjs000066400000000000000000000031751523262174200272450ustar00rootroot00000000000000/* * alias-field * * Exercises the AliasFieldPlugin (package.json `browser` field). The fixture's * package.json remaps several relative paths and bare specifiers, so every * request in the batch either: * - resolves to a remapped replacement, * - resolves to `false` (ignored) -> callback returns `false`, * - or passes through untouched. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], aliasFields: ["browser"], }); const from = path.join(fixtureDir, "src"); const requests = [ "./server", // remapped to ./browser "./fs-shim", // remapped to ./fs-browser "./safe", // untouched (passes through) "./browser", // untouched ]; const resolveMaybeFalse = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); // `false` is a valid "ignored" result for the browser field. resolve(result); }); }); bench.add("alias-field: browser field (warm)", async () => { for (const req of requests) { await resolveMaybeFalse(req); } // And the ignored-via-false case: resolving ./node-only should return // `false` from the browser field, which is a distinct code path. await resolveMaybeFalse("./node-only"); }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/000077500000000000000000000000001523262174200262675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/000077500000000000000000000000001523262174200277555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/package.json000066400000000000000000000000731523262174200322430ustar00rootroot00000000000000{"name":"alias-first-char-miss-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/000077500000000000000000000000001523262174200305445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/index.js000066400000000000000000000000251523262174200322060ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/000077500000000000000000000000001523262174200320325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/a.js000066400000000000000000000000261523262174200326060ustar00rootroot00000000000000module.exports = "a"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/b.js000066400000000000000000000000261523262174200326070ustar00rootroot00000000000000module.exports = "b"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/c.js000066400000000000000000000000261523262174200326100ustar00rootroot00000000000000module.exports = "c"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/d.js000066400000000000000000000000261523262174200326110ustar00rootroot00000000000000module.exports = "d"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/e.js000066400000000000000000000000261523262174200326120ustar00rootroot00000000000000module.exports = "e"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/f.js000066400000000000000000000000261523262174200326130ustar00rootroot00000000000000module.exports = "f"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/g.js000066400000000000000000000000261523262174200326140ustar00rootroot00000000000000module.exports = "g"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/fixture/src/target/h.js000066400000000000000000000000261523262174200326150ustar00rootroot00000000000000module.exports = "h"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-first-char-miss/index.bench.mjs000066400000000000000000000056021523262174200311720ustar00rootroot00000000000000/* * alias-first-char-miss * * Stresses the char-code screen in `AliasUtils.aliasResolveHandler`. The * alias list is populated with entries whose names begin with first * characters the request never starts with. A naive implementation * walks each option calling `innerRequest.startsWith(nameWithSlash)` — * this case makes that walk as cheap as possible by letting the compiled * `firstCharCode` screen reject every option on a single integer compare. * * Companion to `huge-alias-list` / `huge-alias-miss`: those cases share a * first char across the whole list, so they still need the full * `startsWith` check. Here the full `startsWith` path never runs for the * misses, and the real work is one matching `@scope/pkg` entry at the * tail. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const PARALLEL_ALIASES = 300; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const aliases = []; // Generate alias names across many leading characters so that any single // request only matches the first-char bucket for a small fraction of the // list. The char-code screen short-circuits the other ~99%. const letters = "abcdefghijklmnopqrstuvwxyz0123456789"; for (let i = 0; i < PARALLEL_ALIASES; i++) { const char = letters[i % letters.length]; aliases.push({ name: `${char}-unused-${i}`, alias: path.join(fixtureDir, "src/target/a.js"), }); } // Tail entries that actually match — they start with `@` so they only // appear after the linear scan has rejected every `a-*` … `9-*` entry via // the char-code screen. for (const file of ["a", "b", "c", "d", "e", "f", "g", "h"]) { aliases.push({ name: `@tail/${file}`, alias: path.join(fixtureDir, `src/target/${file}.js`), }); } const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: aliases, }); const from = path.join(fixtureDir, "src"); // Requests whose first character (`@`) doesn't match any of the 300 // non-matching alias names. This is the shape of a typical webpack // config with scoped-package aliases mixed in with many legacy aliases. const requests = [ "@tail/a", "@tail/b", "@tail/c", "@tail/d", "@tail/e", "@tail/f", "@tail/g", "@tail/h", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( `alias-first-char-miss: ${PARALLEL_ALIASES} aliases, scoped tail matches`, async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/000077500000000000000000000000001523262174200252335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/000077500000000000000000000000001523262174200267215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/package.json000066400000000000000000000001321523262174200312030ustar00rootroot00000000000000{ "name": "alias-realistic-fixture", "version": "1.0.0", "main": "./src/index.js" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/000077500000000000000000000000001523262174200275105ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/components/000077500000000000000000000000001523262174200316755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/components/Button.js000066400000000000000000000000471523262174200335070ustar00rootroot00000000000000module.exports = function Button() {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/components/Input.js000066400000000000000000000000461523262174200333320ustar00rootroot00000000000000module.exports = function Input() {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/index.js000066400000000000000000000000251523262174200311520ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/lib/000077500000000000000000000000001523262174200302565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/lib/api.js000066400000000000000000000000251523262174200313620ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/lib/store.js000066400000000000000000000000251523262174200317450ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/utils/000077500000000000000000000000001523262174200306505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/utils/format.js000066400000000000000000000000741523262174200324770ustar00rootroot00000000000000module.exports = function format(v) { return String(v); }; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/fixture/src/utils/parse.js000066400000000000000000000000631523262174200323170ustar00rootroot00000000000000module.exports = function parse(v) { return v; }; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-realistic/index.bench.mjs000066400000000000000000000035741523262174200301440ustar00rootroot00000000000000/* * alias-realistic * * Webpack/TS-style path aliases (e.g. `@/components/Button`, `@utils/format`). * Exercises AliasPlugin with a realistic number of entries (not the 50-deep * chain that `pathological-deep-stack` measures) and a mix of matching and * non-matching prefixes so every request walks the alias list. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const aliases = [ { name: "@", alias: path.join(fixtureDir, "src") }, { name: "@components", alias: path.join(fixtureDir, "src/components") }, { name: "@utils", alias: path.join(fixtureDir, "src/utils") }, { name: "@lib", alias: path.join(fixtureDir, "src/lib") }, { name: "~", alias: path.join(fixtureDir, "src") }, ]; const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js", ".json"], alias: aliases, }); const from = path.join(fixtureDir, "src"); const requests = [ "@/components/Button", "@/components/Input", "@/utils/format", "@/utils/parse", "@/lib/api", "@/lib/store", "@components/Button", "@components/Input", "@utils/format", "@utils/parse", "@lib/api", "@lib/store", "~/components/Button", "~/utils/parse", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "alias-realistic: @/path + @components aliases (warm)", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/000077500000000000000000000000001523262174200257675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/000077500000000000000000000000001523262174200274555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/000077500000000000000000000000001523262174200302445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/000077500000000000000000000000001523262174200315325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/a.js000066400000000000000000000000261523262174200323060ustar00rootroot00000000000000module.exports = "a"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/b.js000066400000000000000000000000261523262174200323070ustar00rootroot00000000000000module.exports = "b"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/c.js000066400000000000000000000000261523262174200323100ustar00rootroot00000000000000module.exports = "c"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/d.js000066400000000000000000000000261523262174200323110ustar00rootroot00000000000000module.exports = "d"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/e.js000066400000000000000000000000261523262174200323120ustar00rootroot00000000000000module.exports = "e"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/f.js000066400000000000000000000000261523262174200323130ustar00rootroot00000000000000module.exports = "f"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/g.js000066400000000000000000000000261523262174200323140ustar00rootroot00000000000000module.exports = "g"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/fixture/src/target/h.js000066400000000000000000000000261523262174200323150ustar00rootroot00000000000000module.exports = "h"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/alias-wildcard-scan/index.bench.mjs000066400000000000000000000051101523262174200306640ustar00rootroot00000000000000/* * alias-wildcard-scan * * Complements `large-alias-list` by pushing the per-item work done *inside* * the AliasPlugin scan loop, not just the loop length. Concretely: 100 * parallel non-matching aliases plus one wildcard entry (`pkg-*`) and one * exact match at the tail. Every resolve walks the full list, and for each * item the handler has to decide "is this a wildcard alias?" — previously * that required `item.name.split("*")` on every pass, allocating an array * whose result was immediately thrown away for all non-wildcard items. * * This case specifically stresses that decision so a regression to the * wildcard-detection path shows up cleanly on CodSpeed, separately from the * fixture-IO cost exercised by `large-alias-list`. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const NON_MATCHING_ALIASES = 100; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); // 100 non-matching plain aliases, then one wildcard ("pkg-*"), then a // single plain exact-match ("t-end"). The wildcard sits in the middle // of the list so each resolve walks past non-wildcard items, through // the wildcard, and on to the matching tail entry. const aliases = []; for (let i = 0; i < NON_MATCHING_ALIASES; i++) { aliases.push({ name: `unused-alias-${i}`, alias: path.join(fixtureDir, "src/target/a.js"), }); } aliases.push({ name: "pkg-*", alias: path.join(fixtureDir, "src/target/*.js"), }); aliases.push({ name: "t-end", alias: path.join(fixtureDir, "src/target/h.js"), }); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: aliases, }); const from = path.join(fixtureDir, "src"); // Mix of wildcard hits (pkg-a / pkg-b / ...) and exact-match hits // (t-end). Each request walks the entire alias list once. const requests = [ "pkg-a", "pkg-b", "pkg-c", "pkg-d", "pkg-e", "pkg-f", "pkg-g", "pkg-h", "t-end", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( `alias-wildcard-scan: ${NON_MATCHING_ALIASES}+1 wildcard + 1 exact`, async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/000077500000000000000000000000001523262174200243725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/000077500000000000000000000000001523262174200260605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/package.json000066400000000000000000000000611523262174200303430ustar00rootroot00000000000000{"name":"array-alias-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/000077500000000000000000000000001523262174200266475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/fallback/000077500000000000000000000000001523262174200304065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/fallback/a.js000066400000000000000000000000251523262174200311610ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/fallback/b.js000066400000000000000000000000251523262174200311620ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/fallback/c.js000066400000000000000000000000251523262174200311630ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/preferred/000077500000000000000000000000001523262174200306255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/preferred/a.js000066400000000000000000000000251523262174200314000ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/preferred/b.js000066400000000000000000000000251523262174200314010ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/fixture/src/preferred/c.js000066400000000000000000000000251523262174200314020ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/array-alias/index.bench.mjs000066400000000000000000000031061523262174200272720ustar00rootroot00000000000000/* * array-alias * * An alias whose value is an array of candidates * (`{ name: "@", alias: [preferred, fallback] }`). AliasPlugin tries each * entry in order; the resolver must recurse into the first match, or walk * to the next if it fails. Good for catching regressions in the * multi-target alias handling that's harder to exercise with a single * string alias. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: [ { name: "@", // First entry always matches these requests; the second is the // fallback that would be walked if the first missed. alias: [ path.join(fixtureDir, "src/preferred"), path.join(fixtureDir, "src/fallback"), ], }, ], }); const from = path.join(fixtureDir, "src"); const requests = ["@/a", "@/b", "@/c"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("array-alias: @ -> [preferred, fallback] (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/000077500000000000000000000000001523262174200251665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/000077500000000000000000000000001523262174200266545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/node_modules/000077500000000000000000000000001523262174200313315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/node_modules/dep/000077500000000000000000000000001523262174200321015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/node_modules/dep/index.js000066400000000000000000000000251523262174200335430ustar00rootroot00000000000000module.exports = {}; package.json000066400000000000000000000000651523262174200343110ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/node_modules/dep{"name":"dep","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/package.json000066400000000000000000000000651523262174200311430ustar00rootroot00000000000000{"name":"cache-predicate-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/000077500000000000000000000000001523262174200274435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/cached/000077500000000000000000000000001523262174200306525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/cached/a.js000066400000000000000000000000251523262174200314250ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/cached/b.js000066400000000000000000000000251523262174200314260ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/cached/c.js000066400000000000000000000000251523262174200314270ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/cached/d.js000066400000000000000000000000251523262174200314300ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/cached/e.js000066400000000000000000000000251523262174200314310ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/uncached/000077500000000000000000000000001523262174200312155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/uncached/a.js000066400000000000000000000000251523262174200317700ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/uncached/b.js000066400000000000000000000000251523262174200317710ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/uncached/c.js000066400000000000000000000000251523262174200317720ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/uncached/d.js000066400000000000000000000000251523262174200317730ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/fixture/src/uncached/e.js000066400000000000000000000000251523262174200317740ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cache-predicate/index.bench.mjs000066400000000000000000000036161523262174200300740ustar00rootroot00000000000000/* * cache-predicate * * `cachePredicate` gates which results UnsafeCachePlugin stores. This * case fires a mix of requests where the predicate accepts some and * rejects others, so each bench iteration runs both the fast-path * (cache hit) and the slow-path (re-resolve) for the same resolver. * * Expected shape: first iteration warms the cache for "cached" paths * only, subsequent iterations coast for those and pay full cost for * "uncached" paths. The ratio of the two tells you how much cachePredicate * filtering costs. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); // Only cache things under src/cached; everything else re-resolves. const cachedPrefix = path.join(fixtureDir, "src/cached"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, cachePredicate: (request) => typeof request.path === "string" && request.path.startsWith(cachedPrefix), }); const from = path.join(fixtureDir, "src"); const requests = [ "./cached/a", "./cached/b", "./cached/c", "./cached/d", "./cached/e", "./uncached/a", "./uncached/b", "./uncached/c", "./uncached/d", "./uncached/e", "dep", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "cache-predicate: mixed cached/uncached requests (warm)", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/000077500000000000000000000000001523262174200251375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/000077500000000000000000000000001523262174200266255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-0.js000066400000000000000000000000241523262174200302330ustar00rootroot00000000000000module.exports = 0; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-1.js000066400000000000000000000000241523262174200302340ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-10.js000066400000000000000000000000251523262174200303150ustar00rootroot00000000000000module.exports = 10; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-11.js000066400000000000000000000000251523262174200303160ustar00rootroot00000000000000module.exports = 11; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-12.js000066400000000000000000000000251523262174200303170ustar00rootroot00000000000000module.exports = 12; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-13.js000066400000000000000000000000251523262174200303200ustar00rootroot00000000000000module.exports = 13; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-14.js000066400000000000000000000000251523262174200303210ustar00rootroot00000000000000module.exports = 14; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-15.js000066400000000000000000000000251523262174200303220ustar00rootroot00000000000000module.exports = 15; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-2.js000066400000000000000000000000241523262174200302350ustar00rootroot00000000000000module.exports = 2; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-3.js000066400000000000000000000000241523262174200302360ustar00rootroot00000000000000module.exports = 3; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-4.js000066400000000000000000000000241523262174200302370ustar00rootroot00000000000000module.exports = 4; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-5.js000066400000000000000000000000241523262174200302400ustar00rootroot00000000000000module.exports = 5; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-6.js000066400000000000000000000000241523262174200302410ustar00rootroot00000000000000module.exports = 6; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-7.js000066400000000000000000000000241523262174200302420ustar00rootroot00000000000000module.exports = 7; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-8.js000066400000000000000000000000241523262174200302430ustar00rootroot00000000000000module.exports = 8; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/fixture/file-9.js000066400000000000000000000000241523262174200302440ustar00rootroot00000000000000module.exports = 9; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cached-fs-burst/index.bench.mjs000066400000000000000000000032771523262174200300500ustar00rootroot00000000000000/* * cached-fs-burst * * Measures CachedInputFileSystem's cached-hit dispatch directly, without a * resolver in front. Cache hits are delivered asynchronously; hits issued * from one synchronous burst share a single `process.nextTick` (the first * hit is held in dedicated slots, later ones spill into a queue drained by * the same tick). The concurrent task tracks that batching, the sequential * task guards the single-hit slot path against regressions. * * The cache duration is Infinity so TTL decay never evicts entries * mid-measurement — every call after warmup is a pure cache hit. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const cachedFs = new CachedInputFileSystem(fs, Infinity); const files = Array.from({ length: 16 }, (_, i) => path.join(fixtureDir, `file-${i}.js`), ); /** * @param {string} file file * @returns {Promise} stats */ const stat = (file) => new Promise((resolve, reject) => { cachedFs.stat(file, (err, result) => err ? reject(err) : resolve(result), ); }); bench.add("cached-fs-burst: 64 concurrent cached stat calls", async () => { const promises = []; for (let round = 0; round < 4; round++) { for (const file of files) promises.push(stat(file)); } await Promise.all(promises); }); bench.add("cached-fs-burst: 64 sequential cached stat calls", async () => { for (let round = 0; round < 4; round++) { for (const file of files) await stat(file); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cd-up/000077500000000000000000000000001523262174200231755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/cd-up/index.bench.mjs000066400000000000000000000031161523262174200260760ustar00rootroot00000000000000/* * cd-up * * Directly benchmarks `DescriptionFileUtils.cdUp`, which walks a directory * path one level up. It's called in a loop by `loadDescriptionFile` when * searching for the nearest `package.json` on the ancestor chain, so a * single resolve can trigger it dozens of times. The old implementation * did two full `String#lastIndexOf` scans per call; this bench contrasts * single-level calls, long directory chains walked to the root, and * Windows-style paths. */ import { cdUp } from "../../../lib/DescriptionFileUtils.js"; /** * @param {import("tinybench").Bench} bench bench */ export default function register(bench) { const posixDirs = [ "/", "/home", "/home/user", "/home/user/project", "/home/user/project/src", "/home/user/project/src/components", "/home/user/project/src/components/Button", "/home/user/workspace/packages/pkg-a/src/index", "/home/user/workspace/node_modules/.pnpm/foo@1.0.0/node_modules/foo/dist", ]; const winDirs = [ "C:\\projects\\app\\src\\components\\Button", "C:\\projects\\app\\src\\components", "C:\\projects\\app\\src", "C:\\projects\\app", "C:\\projects", "C:\\", ]; bench.add("cd-up: mixed POSIX + Windows single-level calls", () => { for (let n = 0; n < 2000; n++) { for (let i = 0; i < posixDirs.length; i++) cdUp(posixDirs[i]); for (let i = 0; i < winDirs.length; i++) cdUp(winDirs[i]); } }); bench.add("cd-up: walk to root, 10-level POSIX chain", () => { for (let n = 0; n < 1000; n++) { /** @type {string | null} */ let cur = "/a/b/c/d/e/f/g/h/i/j"; while (cur) cur = cdUp(cur); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/000077500000000000000000000000001523262174200254265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/000077500000000000000000000000001523262174200271145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/000077500000000000000000000000001523262174200315715ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-a/000077500000000000000000000000001523262174200325575ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200341420ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-amodule.exports = {}; package.json000066400000000000000000000000671523262174200347710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-a{"name":"dep-a","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-b/000077500000000000000000000000001523262174200325605ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200341430ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-bmodule.exports = {}; package.json000066400000000000000000000000671523262174200347720ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-b{"name":"dep-b","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-c/000077500000000000000000000000001523262174200325615ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200341440ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-cmodule.exports = {}; package.json000066400000000000000000000000671523262174200347730ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/node_modules/dep-c{"name":"dep-c","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/package.json000066400000000000000000000000661523262174200314040ustar00rootroot00000000000000{"name":"concurrent-batch-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/000077500000000000000000000000001523262174200277035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/a.js000066400000000000000000000000251523262174200304560ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/b.js000066400000000000000000000000251523262174200304570ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/c.js000066400000000000000000000000251523262174200304600ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/d.js000066400000000000000000000000251523262174200304610ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/e.js000066400000000000000000000000251523262174200304620ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/f.js000066400000000000000000000000251523262174200304630ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/g.js000066400000000000000000000000251523262174200304640ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/h.js000066400000000000000000000000251523262174200304650ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/i.js000066400000000000000000000000251523262174200304660ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/j.js000066400000000000000000000000251523262174200304670ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/k.js000066400000000000000000000000251523262174200304700ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/fixture/src/l.js000066400000000000000000000000251523262174200304710ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/concurrent-batch/index.bench.mjs000066400000000000000000000030561523262174200303320ustar00rootroot00000000000000/* * concurrent-batch * * Measures in-flight parallelism: a batch of 15 resolves fired through * Promise.all rather than sequentially. Real build tools (webpack, * bundlers, test runners) dispatch many concurrent resolves per module * graph pass, and enhanced-resolve has in-flight request de-duplication * (`_activeAsyncOperations` in CachedInputFileSystem) that should make * concurrent calls cheap. This case is the one that would catch any * regression in that concurrent-request handling. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); const from = path.join(fixtureDir, "src"); const requests = [ "./a", "./b", "./c", "./d", "./e", "./f", "./g", "./h", "./i", "./j", "./k", "./l", "dep-a", "dep-b", "dep-c", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("concurrent-batch: Promise.all of 15 resolves (warm)", async () => { await Promise.all(requests.map((r) => resolve(r))); }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/000077500000000000000000000000001523262174200250565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/000077500000000000000000000000001523262174200265445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/node_modules/000077500000000000000000000000001523262174200312215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/node_modules/top-dep/000077500000000000000000000000001523262174200325715ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200341540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/node_modules/top-depmodule.exports = {}; package.json000066400000000000000000000000711523262174200347760ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/node_modules/top-dep{"name":"top-dep","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/package.json000066400000000000000000000000641523262174200310320ustar00rootroot00000000000000{"name":"deep-hierarchy-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/000077500000000000000000000000001523262174200273335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/000077500000000000000000000000001523262174200275535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/000077500000000000000000000000001523262174200277745ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/000077500000000000000000000000001523262174200302165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/000077500000000000000000000000001523262174200304415ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/e/000077500000000000000000000000001523262174200306655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/e/f/000077500000000000000000000000001523262174200311125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/e/f/g/000077500000000000000000000000001523262174200313405ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/e/f/g/h/000077500000000000000000000000001523262174200315675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/e/f/g/h/i/000077500000000000000000000000001523262174200320175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/e/f/g/h/i/j/000077500000000000000000000000001523262174200322505ustar00rootroot00000000000000leaf.js000066400000000000000000000000251523262174200334330ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/fixture/src/a/b/c/d/e/f/g/h/i/jmodule.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-hierarchy/index.bench.mjs000066400000000000000000000027371523262174200277670ustar00rootroot00000000000000/* * deep-hierarchy * * Resolves a bare specifier from 10 directory levels deep. The * ModulesInHierarchicalDirectoriesPlugin walks up the tree checking * `/node_modules/` at each step, so the cold-start cost grows * linearly with depth. This exercises that walk specifically. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); const deep = path.join(fixtureDir, "src/a/b/c/d/e/f/g/h/i/j"); const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, deep, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "deep-hierarchy: bare specifier from 10-deep dir (warm)", async () => { // 5 resolves per iteration so the body is long enough for tinybench // to get stable samples. for (let i = 0; i < 5; i++) { await resolve("top-dep"); } }, ); bench.add("deep-hierarchy: relative from 10-deep dir (warm)", async () => { for (let i = 0; i < 5; i++) { await resolve("./leaf"); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/000077500000000000000000000000001523262174200261375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/000077500000000000000000000000001523262174200276255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/index.js000066400000000000000000000000251523262174200312670ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/000077500000000000000000000000001523262174200323025ustar00rootroot00000000000000lodash-like/000077500000000000000000000000001523262174200344175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modulesfp/000077500000000000000000000000001523262174200350245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-likechunk.js000066400000000000000000000000251523262174200364670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fpmodule.exports = {}; extras/000077500000000000000000000000001523262174200363325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fpdefaults.js000066400000000000000000000000251523262174200404740ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fp/extrasmodule.exports = {}; omit.js000066400000000000000000000000251523262174200376350ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fp/extrasmodule.exports = {}; pickBy.js000066400000000000000000000000251523262174200401060ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fp/extrasmodule.exports = {}; flatMap.js000066400000000000000000000000251523262174200367430ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fpmodule.exports = {}; flow.js000066400000000000000000000000251523262174200363260ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fpmodule.exports = {}; index.js000066400000000000000000000000251523262174200364660ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fpmodule.exports = {}; memoize.js000066400000000000000000000000251523262174200370240ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fpmodule.exports = {}; pick.js000066400000000000000000000000251523262174200363050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like/fpmodule.exports = {}; index.js000066400000000000000000000000251523262174200360610ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-likemodule.exports = {}; package.json000066400000000000000000000000751523262174200367070ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/node_modules/lodash-like{"name":"lodash-like","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/fixture/package.json000066400000000000000000000000721523262174200321120ustar00rootroot00000000000000{"name":"deep-package-subpath-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/deep-package-subpath/index.bench.mjs000066400000000000000000000030351523262174200310400ustar00rootroot00000000000000/* * deep-package-subpath * * A mix of `pkg/sub`, `pkg/sub/leaf`, and `pkg/deep/nested/leaf` requests * into a single package — the shape produced by libraries like lodash, * lodash/fp, rxjs/operators, or date-fns. No exports field; just plain * directory traversal after the package has been located, so this measures * the JoinRequestPartPlugin + relative-resolution pipeline after the * package boundary. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); const from = fixtureDir; const requests = [ "lodash-like", "lodash-like/fp/flow", "lodash-like/fp/flatMap", "lodash-like/fp/pick", "lodash-like/fp/chunk", "lodash-like/fp/memoize", "lodash-like/fp/extras/pickBy", "lodash-like/fp/extras/omit", "lodash-like/fp/extras/defaults", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("deep-package-subpath: pkg/a/b/c requests (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/000077500000000000000000000000001523262174200267405ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/000077500000000000000000000000001523262174200304265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/000077500000000000000000000000001523262174200331035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-a/000077500000000000000000000000001523262174200341025ustar00rootroot00000000000000bower.json000066400000000000000000000000511523262174200360300ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-a{"name":"pkg-a","main":"./lib/index.js"} lib/000077500000000000000000000000001523262174200345715ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-aindex.js000066400000000000000000000000251523262174200362330ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-a/libmodule.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-b/000077500000000000000000000000001523262174200341035ustar00rootroot00000000000000dist/000077500000000000000000000000001523262174200347675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-bindex.js000066400000000000000000000000251523262174200364310ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-b/distmodule.exports = {}; package.json000066400000000000000000000000521523262174200363070ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-b{"name":"pkg-b","main":"./dist/index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-c/000077500000000000000000000000001523262174200341045ustar00rootroot00000000000000component.json000066400000000000000000000000511523262174200367160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-c{"name":"pkg-c","main":"./src/index.js"} src/000077500000000000000000000000001523262174200346145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-cindex.js000066400000000000000000000000251523262174200362560ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/node_modules/pkg-c/srcmodule.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/fixture/package.json000066400000000000000000000000751523262174200327160ustar00rootroot00000000000000{"name":"description-files-multi-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/description-files-multi/index.bench.mjs000066400000000000000000000025771523262174200316530ustar00rootroot00000000000000/* * description-files-multi * * `descriptionFiles` configured to include bower.json and component.json * alongside package.json. Every package directory lookup has to read each * candidate in order, so projects that opt into alternative description * files pay an extra cost per resolve. This case measures that cost on a * mix of packages that advertise themselves via different description * files. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], descriptionFiles: ["package.json", "bower.json", "component.json"], }); const requests = ["pkg-a", "pkg-b", "pkg-c"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, fixtureDir, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "description-files-multi: package.json + bower + component (warm)", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/000077500000000000000000000000001523262174200256205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/000077500000000000000000000000001523262174200273065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/package.json000066400000000000000000000000671523262174200315770ustar00rootroot00000000000000{"name":"enforce-extension-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/src/000077500000000000000000000000001523262174200300755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/src/a.js000066400000000000000000000000251523262174200306500ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/src/b.js000066400000000000000000000000251523262174200306510ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/src/c.js000066400000000000000000000000251523262174200306520ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/src/d.js000066400000000000000000000000251523262174200306530ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/src/e.js000066400000000000000000000000251523262174200306540ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/fixture/src/f.js000066400000000000000000000000251523262174200306550ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/enforce-extension/index.bench.mjs000066400000000000000000000030301523262174200305140ustar00rootroot00000000000000/* * enforce-extension * * `enforceExtension: true` drops the "no extension" TryNextPlugin path — * the resolver *only* succeeds if one of the configured extensions has * been appended. Worth tracking separately from `fully-specified` * (which additionally skips directory fallback). * * The bare specifiers below are expected to be extended by the resolver * to `./a.js`, `./b.js`, ... via AppendPlugin. Handing in requests that * already include the extension would instead produce `./a.js.js` (the * AppendPlugin is unconditional) and fail. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], enforceExtension: true, }); const from = path.join(fixtureDir, "src"); const requests = ["./a", "./b", "./c", "./d", "./e", "./f"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("enforce-extension: explicit .js requests (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/000077500000000000000000000000001523262174200247525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/000077500000000000000000000000001523262174200264405ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/000077500000000000000000000000001523262174200311155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/000077500000000000000000000000001523262174200342665ustar00rootroot00000000000000dist/000077500000000000000000000000001523262174200351525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exportsfeatures/000077500000000000000000000000001523262174200367705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distalpha.cjs000066400000000000000000000000251523262174200405530ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; alpha.js000066400000000000000000000000251523262174200404100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; alpha.mjs000066400000000000000000000000251523262174200405650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; beta.cjs000066400000000000000000000000251523262174200404010ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; beta.js000066400000000000000000000000251523262174200402360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; beta.mjs000066400000000000000000000000251523262174200404130ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; delta.cjs000066400000000000000000000000251523262174200405570ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; delta.js000066400000000000000000000000251523262174200404140ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; delta.mjs000066400000000000000000000000251523262174200405710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; gamma.cjs000066400000000000000000000000251523262174200405500ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; gamma.js000066400000000000000000000000251523262174200404050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; gamma.mjs000066400000000000000000000000251523262174200405620ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/featuresmodule.exports = {}; index.cjs000066400000000000000000000000251523262174200367570ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distmodule.exports = {}; index.d.ts000066400000000000000000000000251523262174200370500ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distmodule.exports = {}; index.js000066400000000000000000000000251523262174200366140ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distmodule.exports = {}; index.mjs000066400000000000000000000000251523262174200367710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distmodule.exports = {}; index.node.cjs000066400000000000000000000000251523262174200377030ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distmodule.exports = {}; index.node.mjs000066400000000000000000000000251523262174200377150ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distmodule.exports = {}; internal/000077500000000000000000000000001523262174200367665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/distutil1.js000066400000000000000000000000251523262174200403570ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/internalmodule.exports = {}; util1.mjs000066400000000000000000000000251523262174200405340ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/internalmodule.exports = {}; util2.js000066400000000000000000000000251523262174200403600ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/internalmodule.exports = {}; util2.mjs000066400000000000000000000000251523262174200405350ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/internalmodule.exports = {}; util3.js000066400000000000000000000000251523262174200403610ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/internalmodule.exports = {}; util3.mjs000066400000000000000000000000251523262174200405360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports/dist/internalmodule.exports = {}; legacy.cjs000066400000000000000000000000251523262174200361510ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exportsmodule.exports = {}; legacy.js000066400000000000000000000000251523262174200360060ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exportsmodule.exports = {}; package.json000066400000000000000000000014011523262174200364710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/node_modules/complex-exports{ "name": "complex-exports", "version": "1.0.0", "exports": { ".": { "types": "./dist/index.d.ts", "import": { "node": "./dist/index.node.mjs", "default": "./dist/index.mjs" }, "require": { "node": "./dist/index.node.cjs", "default": "./dist/index.cjs" }, "default": "./dist/index.js" }, "./features/*": { "import": "./dist/features/*.mjs", "require": "./dist/features/*.cjs", "default": "./dist/features/*.js" }, "./internal/*.js": { "import": "./dist/internal/*.mjs", "default": "./dist/internal/*.js" }, "./legacy": { "require": "./legacy.cjs", "default": "./legacy.js" }, "./package.json": "./package.json" } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/fixture/package.json000066400000000000000000000000741523262174200307270ustar00rootroot00000000000000{ "name": "exports-field-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-field/index.bench.mjs000066400000000000000000000040271523262174200276550ustar00rootroot00000000000000/* * exports-field * * Exercises the ExportsFieldPlugin with a package that has: * - nested condition maps (node/default, import/require, types) * - pattern (wildcard) subpath exports like `./features/*` * - pattern exports that match `*.js` extensions * - a plain string mapping (`./legacy`) * - a package.json re-export * * Uses two separate resolvers with different condition sets so we get both * the "require" and "import" branch of the hot exports matching code. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const requireResolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], conditionNames: ["node", "require"], }); const importResolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], conditionNames: ["node", "import"], }); const requests = [ "complex-exports", "complex-exports/features/alpha", "complex-exports/features/beta", "complex-exports/features/gamma", "complex-exports/features/delta", "complex-exports/internal/util1.js", "complex-exports/internal/util2.js", "complex-exports/internal/util3.js", "complex-exports/legacy", "complex-exports/package.json", ]; const resolve = (resolver, req) => new Promise((resolve, reject) => { resolver.resolve({}, fixtureDir, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("exports-field: conditions=require,node (warm)", async () => { for (const req of requests) { await resolve(requireResolver, req); } }); bench.add("exports-field: conditions=import,node (warm)", async () => { for (const req of requests) { await resolve(importResolver, req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/000077500000000000000000000000001523262174200264715ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/000077500000000000000000000000001523262174200301575ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/000077500000000000000000000000001523262174200326345ustar00rootroot00000000000000many-patterns/000077500000000000000000000000001523262174200353575ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modulesdist/000077500000000000000000000000001523262174200363225ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patternscharts/000077500000000000000000000000001523262174200376065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/distalpha.js000066400000000000000000000000251523262174200412260ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/chartsmodule.exports = {}; beta.js000066400000000000000000000000251523262174200410540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/chartsmodule.exports = {}; delta.js000066400000000000000000000000251523262174200412320ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/chartsmodule.exports = {}; gamma.js000066400000000000000000000000251523262174200412230ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/chartsmodule.exports = {}; data/000077500000000000000000000000001523262174200372335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/distalpha.js000066400000000000000000000000251523262174200406530ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/datamodule.exports = {}; beta.js000066400000000000000000000000251523262174200405010ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/datamodule.exports = {}; delta.js000066400000000000000000000000251523262174200406570ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/datamodule.exports = {}; gamma.js000066400000000000000000000000251523262174200406500ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/datamodule.exports = {}; forms/000077500000000000000000000000001523262174200374505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/distalpha.js000066400000000000000000000000251523262174200410700ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/formsmodule.exports = {}; beta.js000066400000000000000000000000251523262174200407160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/formsmodule.exports = {}; delta.js000066400000000000000000000000251523262174200410740ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/formsmodule.exports = {}; gamma.js000066400000000000000000000000251523262174200410650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/formsmodule.exports = {}; hooks/000077500000000000000000000000001523262174200374455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/distalpha.js000066400000000000000000000000251523262174200410650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/hooksmodule.exports = {}; beta.js000066400000000000000000000000251523262174200407130ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/hooksmodule.exports = {}; delta.js000066400000000000000000000000251523262174200410710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/hooksmodule.exports = {}; gamma.js000066400000000000000000000000251523262174200410620ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/hooksmodule.exports = {}; layout/000077500000000000000000000000001523262174200376375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/distalpha.js000066400000000000000000000000251523262174200412570ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/layoutmodule.exports = {}; beta.js000066400000000000000000000000251523262174200411050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/layoutmodule.exports = {}; delta.js000066400000000000000000000000251523262174200412630ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/layoutmodule.exports = {}; gamma.js000066400000000000000000000000251523262174200412540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/layoutmodule.exports = {}; ui/000077500000000000000000000000001523262174200367375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/distalpha.js000066400000000000000000000000251523262174200403570ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/uimodule.exports = {}; beta.js000066400000000000000000000000251523262174200402050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/uimodule.exports = {}; delta.js000066400000000000000000000000251523262174200403630ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/uimodule.exports = {}; gamma.js000066400000000000000000000000251523262174200403540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns/dist/uimodule.exports = {}; package.json000066400000000000000000000004471523262174200376520ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/node_modules/many-patterns{ "name": "many-patterns", "version": "1.0.0", "exports": { "./ui/*": "./dist/ui/*.js", "./data/*": "./dist/data/*.js", "./forms/*": "./dist/forms/*.js", "./charts/*": "./dist/charts/*.js", "./layout/*": "./dist/layout/*.js", "./hooks/*": "./dist/hooks/*.js" } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/fixture/package.json000066400000000000000000000000731523262174200324450ustar00rootroot00000000000000{"name":"exports-patterns-many-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/exports-patterns-many/index.bench.mjs000066400000000000000000000030671523262174200313770ustar00rootroot00000000000000/* * exports-patterns-many * * Targets the ExportsFieldPlugin's pattern-matching path specifically: * a package with 6 wildcard subpaths (`./ui/*`, `./data/*`, ...) and a * batch of requests that hit different prefixes. Each resolve has to * evaluate subpath patterns from longest-prefix-first, so this case * stresses that lookup and is a good sentinel for regressions in the * exports-field pattern matcher. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); const from = fixtureDir; const prefixes = ["ui", "data", "forms", "charts", "layout", "hooks"]; const leaves = ["alpha", "beta", "gamma", "delta"]; /** @type {string[]} */ const requests = []; for (const prefix of prefixes) { for (const leaf of leaves) { requests.push(`many-patterns/${prefix}/${leaf}`); } } const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("exports-patterns-many: 6 prefixes x 4 leaves (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/000077500000000000000000000000001523262174200262325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/000077500000000000000000000000001523262174200277205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/package.json000066400000000000000000000000721523262174200322050ustar00rootroot00000000000000{"name":"extension-alias-many-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/000077500000000000000000000000001523262174200305075ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/a.ts000066400000000000000000000000231523262174200312720ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/a.tsx000066400000000000000000000000231523262174200314620ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/b.ts000066400000000000000000000000231523262174200312730ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/b.tsx000066400000000000000000000000231523262174200314630ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/c.ts000066400000000000000000000000231523262174200312740ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/c.tsx000066400000000000000000000000231523262174200314640ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/d.ts000066400000000000000000000000231523262174200312750ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/fixture/src/d.tsx000066400000000000000000000000231523262174200314650ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias-many/index.bench.mjs000066400000000000000000000032431523262174200311340ustar00rootroot00000000000000/* * extension-alias-many * * `extensionAlias` with multiple source extensions (`.js -> [.ts, .tsx]`, * `.mjs -> [.mts]`, `.cjs -> [.cts]`). Each request has to walk the alias * list for its trailing extension and try every candidate in order. This * complements `extension-alias` (a simpler single-mapping case). */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js", ".mjs", ".cjs"], extensionAlias: { ".js": [".ts", ".tsx", ".js"], ".mjs": [".mts", ".mjs"], ".cjs": [".cts", ".cjs"], }, }); const from = path.join(fixtureDir, "src"); // `.js` requests — the alias list tries `.ts` first (matches), then `.tsx` // if no `.ts`. Mix both so the fallback inside the alias list is exercised. const requests = [ "./a.js", // resolves to a.ts "./b.js", // resolves to b.ts "./c.js", // resolves to c.ts "./d.js", // resolves to d.ts ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "extension-alias-many: 3 source exts with fallbacks (warm)", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/000077500000000000000000000000001523262174200252705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/000077500000000000000000000000001523262174200267565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/package.json000066400000000000000000000000761523262174200312470ustar00rootroot00000000000000{ "name": "extension-alias-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/000077500000000000000000000000001523262174200275455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/a.ts000066400000000000000000000000231523262174200303300ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/b.ts000066400000000000000000000000231523262174200303310ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/c.ts000066400000000000000000000000231523262174200303320ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/d.ts000066400000000000000000000000231523262174200303330ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/e.ts000066400000000000000000000000231523262174200303340ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/f.ts000066400000000000000000000000231523262174200303350ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/g.ts000066400000000000000000000000231523262174200303360ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/h.ts000066400000000000000000000000231523262174200303370ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/index.ts000066400000000000000000000000231523262174200312170ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/fixture/src/mixed.ts000066400000000000000000000000231523262174200312160ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extension-alias/index.bench.mjs000066400000000000000000000024631523262174200301750ustar00rootroot00000000000000/* * extension-alias * * TypeScript-style workflow where authored `import "./foo.js"` specifiers * should resolve to `./foo.ts` on disk. Exercises ExtensionAliasPlugin, * which is on the hot path for every `.js` request in a TS project. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], extensionAlias: { ".js": [".ts", ".js"], }, }); const from = path.join(fixtureDir, "src"); const requests = [ "./a.js", "./b.js", "./c.js", "./d.js", "./e.js", "./f.js", "./g.js", "./h.js", "./mixed.js", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("extension-alias: .js -> .ts (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/000077500000000000000000000000001523262174200253265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/000077500000000000000000000000001523262174200270145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/package.json000066400000000000000000000000761523262174200313050ustar00rootroot00000000000000{ "name": "extensions-many-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/src/000077500000000000000000000000001523262174200276035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/src/a.js000066400000000000000000000000251523262174200303560ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/src/b.json000066400000000000000000000000031523262174200307100ustar00rootroot00000000000000{} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/src/c.mjs000066400000000000000000000000251523262174200305350ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/src/d.ts000066400000000000000000000000231523262174200303710ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/src/e.tsx000066400000000000000000000000231523262174200305620ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/fixture/src/f.jsx000066400000000000000000000000231523262174200305510ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/extensions-many/index.bench.mjs000066400000000000000000000032201523262174200302230ustar00rootroot00000000000000/* * extensions-many * * Exercises the AppendPlugin / TryNextPlugin path for extension resolution * with a long list of candidate extensions. Each resolver tries each * extension in order, so a request that ends up matching only the last * extension (`.jsx`) has to walk past all the preceding ones. This is the * relevant workload for projects that configure many extensions. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx", ".mjs", ".js", ".jsx", ".json"], }); const from = path.join(fixtureDir, "src"); // Request list deliberately hits extensions at different positions in // the list, including the last one (.json / .jsx) where the extension // loop has to walk the furthest. const requests = [ "./a", // .js (middle) "./b", // .json (last) "./c", // .mjs "./d", // .ts (first) "./e", // .tsx (second) "./f", // .jsx (near end) ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("extensions-many: 6-extension list (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/failed-resolution/000077500000000000000000000000001523262174200256125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/failed-resolution/fixture/000077500000000000000000000000001523262174200273005ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/failed-resolution/fixture/package.json000066400000000000000000000000671523262174200315710ustar00rootroot00000000000000{"name":"failed-resolution-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/failed-resolution/fixture/src/000077500000000000000000000000001523262174200300675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/failed-resolution/fixture/src/exists.js000066400000000000000000000000251523262174200317410ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/failed-resolution/fixture/src/index.js000066400000000000000000000000251523262174200315310ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/failed-resolution/index.bench.mjs000066400000000000000000000032411523262174200305120ustar00rootroot00000000000000/* * failed-resolution * * Measures the error path: requests that don't resolve to anything. This is * on the hot path in real projects because tooling (e.g. TypeScript, webpack * DllReferencePlugin, loaders) frequently probes multiple candidates and * expects most of them to miss before the final match. * * Every bench iteration fires a batch of failing requests; the resolver has * to walk every configured plugin before reporting the miss. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js", ".json"], }); const from = path.join(fixtureDir, "src"); // None of these exist on disk. Each one must walk the full pipeline — // extensions tried, directory checked, node_modules walked — before // returning an error. const missingRequests = [ "./does-not-exist", "./also/missing", "./exists-but-not-really", "missing-package", "@missing/scope", "./nope/nope/nope", ]; const resolveExpectingError = (req) => new Promise((resolve) => { resolver.resolve({}, from, req, {}, (err) => { // Intentional: we're measuring the time to *fail*, not to succeed. resolve(err); }); }); bench.add("failed-resolution: missing files + packages", async () => { for (const req of missingRequests) { await resolveExpectingError(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/000077500000000000000000000000001523262174200237245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/000077500000000000000000000000001523262174200254125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/package.json000066400000000000000000000000671523262174200277030ustar00rootroot00000000000000{ "name": "fallback-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/src/000077500000000000000000000000001523262174200262015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/src/index.js000066400000000000000000000000251523262174200276430ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/src/shims/000077500000000000000000000000001523262174200273245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/src/shims/buffer.js000066400000000000000000000000251523262174200311300ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/src/shims/crypto.js000066400000000000000000000000251523262174200311770ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/src/shims/stream.js000066400000000000000000000000251523262174200311520ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/fixture/src/shims/util.js000066400000000000000000000000251523262174200306340ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fallback/index.bench.mjs000066400000000000000000000031061523262174200266240ustar00rootroot00000000000000/* * fallback * * Exercises the `fallback` aliases (webpack's `resolve.fallback`). Fallback * entries only kick in after normal resolution has failed for a bare * specifier, so this case measures the "module-not-found -> fallback" * detour. Common pattern for providing Node built-in shims in browser builds. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], fallback: [ { name: "crypto", alias: path.join(fixtureDir, "src/shims/crypto.js") }, { name: "buffer", alias: path.join(fixtureDir, "src/shims/buffer.js") }, { name: "stream", alias: path.join(fixtureDir, "src/shims/stream.js") }, { name: "util", alias: path.join(fixtureDir, "src/shims/util.js") }, ], }); const from = path.join(fixtureDir, "src"); const requests = ["crypto", "buffer", "stream", "util"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("fallback: node-builtin polyfill aliases (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/000077500000000000000000000000001523262174200252515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/000077500000000000000000000000001523262174200267375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/package.json000066400000000000000000000001221523262174200312200ustar00rootroot00000000000000{ "name": "fully-specified-fixture", "version": "1.0.0", "type": "module" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/000077500000000000000000000000001523262174200275265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/a.mjs000066400000000000000000000000231523262174200304540ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/b.mjs000066400000000000000000000000231523262174200304550ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/c.mjs000066400000000000000000000000231523262174200304560ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/d.mjs000066400000000000000000000000231523262174200304570ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/e.mjs000066400000000000000000000000231523262174200304600ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/f.mjs000066400000000000000000000000231523262174200304610ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/fixture/src/index.mjs000066400000000000000000000000231523262174200313430ustar00rootroot00000000000000export default {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/fully-specified/index.bench.mjs000066400000000000000000000026441523262174200301570ustar00rootroot00000000000000/* * fully-specified * * ESM-style resolution where every specifier must include the file extension * and directory fallbacks are disabled. Exercises the `fullySpecified: true` * code path which short-circuits several plugins (AppendPlugin / TryNext * combos and the "as directory" conditional) — so the hot path here is * tighter than the normal-resolve case. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".mjs"], fullySpecified: true, conditionNames: ["node", "import"], }); const from = path.join(fixtureDir, "src"); const requests = [ "./a.mjs", "./b.mjs", "./c.mjs", "./d.mjs", "./e.mjs", "./f.mjs", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("fully-specified: ESM-style imports (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/get-inner-request/000077500000000000000000000000001523262174200255435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/get-inner-request/index.bench.mjs000066400000000000000000000052031523262174200304430ustar00rootroot00000000000000/* * get-inner-request * * Directly benchmarks `lib/getInnerRequest.js`. It is called from most * resolve-step plugins that need the "effective" request for a package * (AliasFieldPlugin, RestrictionsPlugin, ExportsFieldPlugin, ...), so it * fires multiple times per resolve. The cheap path is "request has no * relative prefix" — we used to pay a regex-dispatch for that check; this * bench exercises that plus a mix of relative/absolute shapes. */ import getInnerRequest from "../../../lib/getInnerRequest.js"; /** * Minimal resolver stand-in: the function only calls `resolver.join` on the * relative-prefix path, so any two-arg joiner is fine for benchmark purposes. */ const fakeResolver = { join(a, b) { return `${a}/${b}`; }, }; /** * @param {import("tinybench").Bench} bench bench */ export default function register(bench) { // A mix of request shapes: the cheap no-relative-prefix path dominates in // real workloads, so it's weighted here too. const requests = [ { request: "lodash", relativePath: "./" }, { request: "react/jsx-runtime", relativePath: "./" }, { request: "@scope/pkg/subpath", relativePath: "./src" }, { request: "./Button", relativePath: "./src/components" }, { request: "../utils/format", relativePath: "./src/components/Button" }, { request: "../../shared", relativePath: "./src/components/Button" }, { request: ".", relativePath: "./src" }, { request: "..", relativePath: "./src/components" }, { request: "./a", relativePath: "./pkg" }, { request: "some-dep/deep/path", relativePath: "./" }, { request: "#internal", relativePath: "./lib" }, { request: "@my/pkg", relativePath: "./" }, ]; bench.add("get-inner-request: mixed request shapes (cold each time)", () => { for (let n = 0; n < 500; n++) { for (let i = 0; i < requests.length; i++) { // Fresh shallow copies each iteration so the __innerRequest memo // cache miss path is what we measure (the regex replacement is // what matters for the cold case). const shape = requests[i]; const req = { request: shape.request, relativePath: shape.relativePath, }; getInnerRequest(fakeResolver, req); } } }); bench.add("get-inner-request: memoized hot repeats on same object", () => { // Reuse the same request object across calls so the memo fast path // returns immediately. This path used to test three fields before // returning the cached result; keep it measurable. const req = { request: "./deeply/nested/module", relativePath: "./src/a/b", }; // Prime the memo getInnerRequest(fakeResolver, req); for (let n = 0; n < 20000; n++) { getInnerRequest(fakeResolver, req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/get-paths/000077500000000000000000000000001523262174200240615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/get-paths/index.bench.mjs000066400000000000000000000037201523262174200267630ustar00rootroot00000000000000/* * get-paths * * Directly benchmarks `lib/getPaths.js`, the helper that turns * /a/b/c/d.js -> [/a/b/c/d.js, /a/b/c, /a/b, /a, /] + matching segments * and is called once per module resolve through * `ModulesInHierarchicalDirectoriesPlugin`. The previous implementation * built the list by `String#split` against a capture-group regex and then * walking the resulting parts array; this benchmark stresses that code * path with realistic depths (project files, workspace absolute paths, * deeply nested node_modules paths, and a Windows-style drive letter * path) so a regression on the split replacement shows up as an obvious * ops/s drop in the report. */ import getPaths from "../../../lib/getPaths.js"; /** * @param {import("tinybench").Bench} bench bench */ export default function register(bench) { const inputs = [ "/home/user/project/src/a/b/c/d.js", "/home/user/project/src", "/home/user/project", "/home/user/workspace/packages/pkg-a/src/index.ts", "/home/user/workspace/packages/pkg-a/src/components/Button/index.tsx", "/home/user/workspace/node_modules/.pnpm/foo@1.0.0/node_modules/foo/dist/index.js", "/a/b/c", "/a/b/c/d/e/f/g/h/i/j", "/foo", "/", "C:\\projects\\app\\src\\index.ts", "C:\\Users\\dev\\workspace\\packages\\pkg\\dist\\index.js", "relative/no/absolute/path/here.js", ]; bench.add("get-paths: mixed absolute + Windows + bare inputs", () => { // Loop enough to keep the body above tinybench's measurability floor // under CodSpeed's single-iteration instrumentation run. for (let n = 0; n < 200; n++) { for (let i = 0; i < inputs.length; i++) { const { paths, segments } = getPaths(inputs[i]); if (paths.length === 0 || segments.length === 0) { throw new Error("unexpected empty result"); } } } }); bench.add("get-paths: deep 10-level POSIX path only", () => { const deep = "/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t.js"; for (let n = 0; n < 1000; n++) { getPaths(deep); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/000077500000000000000000000000001523262174200251555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/000077500000000000000000000000001523262174200266435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/package.json000066400000000000000000000000651523262174200311320ustar00rootroot00000000000000{"name":"huge-alias-list-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/000077500000000000000000000000001523262174200274325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/index.js000066400000000000000000000000251523262174200310740ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/000077500000000000000000000000001523262174200307205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/a.js000066400000000000000000000000251523262174200314730ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/b.js000066400000000000000000000000251523262174200314740ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/c.js000066400000000000000000000000251523262174200314750ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/d.js000066400000000000000000000000251523262174200314760ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/e.js000066400000000000000000000000251523262174200314770ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/f.js000066400000000000000000000000251523262174200315000ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/g.js000066400000000000000000000000251523262174200315010ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/fixture/src/target/h.js000066400000000000000000000000251523262174200315020ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-list/index.bench.mjs000066400000000000000000000036511523262174200300620ustar00rootroot00000000000000/* * huge-alias-list * * Scales `large-alias-list` up to the PR-438 territory: projects with several * hundred alias entries in the webpack config (monorepos, generated aliases * from a workspace graph, etc.). Every resolve has to linearly walk the full * alias list, so this case is particularly sensitive to per-option work * (string concat, split, closure creation) inside AliasPlugin's scan. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const PARALLEL_ALIASES = 300; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const aliases = []; for (let i = 0; i < PARALLEL_ALIASES; i++) { aliases.push({ name: `unused-alias-${i}`, alias: path.join(fixtureDir, "src/target/a.js"), }); } for (const fixture of ["a", "b", "c", "d", "e", "f", "g", "h"]) { aliases.push({ name: `t-${fixture}`, alias: path.join(fixtureDir, `src/target/${fixture}.js`), }); } const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: aliases, }); const from = path.join(fixtureDir, "src"); // Requests match aliases positioned at the tail of the list so every // resolve walks the full 300-entry array before finding a hit. const requests = ["t-a", "t-b", "t-c", "t-d", "t-e", "t-f", "t-g", "t-h"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( `huge-alias-list: ${PARALLEL_ALIASES}+8 aliases, match near end`, async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/000077500000000000000000000000001523262174200251555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/000077500000000000000000000000001523262174200266435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/package.json000066400000000000000000000000651523262174200311320ustar00rootroot00000000000000{"name":"huge-alias-miss-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/src/000077500000000000000000000000001523262174200274325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/src/index.js000066400000000000000000000000251523262174200310740ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/src/target/000077500000000000000000000000001523262174200307205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/src/target/a.js000066400000000000000000000000251523262174200314730ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/src/target/b.js000066400000000000000000000000251523262174200314740ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/fixture/src/target/c.js000066400000000000000000000000251523262174200314750ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/huge-alias-miss/index.bench.mjs000066400000000000000000000034041523262174200300560ustar00rootroot00000000000000/* * huge-alias-miss * * Companion to `huge-alias-list` for the other common shape in big configs: * plain relative requests that do NOT match any alias entry. AliasPlugin * still walks the entire alias list before falling through, so the miss path * is the purest measurement of per-option overhead (the matching branch never * runs, no `doResolve` recursion). */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const PARALLEL_ALIASES = 300; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const aliases = []; for (let i = 0; i < PARALLEL_ALIASES; i++) { aliases.push({ name: `unused-alias-${i}`, alias: path.join(fixtureDir, "src/target/a.js"), }); } const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: aliases, }); const from = path.join(fixtureDir, "src"); // Relative requests that never match any alias — the resolver walks the // full 300-entry list twice (once for `fallback`, once for `alias`) before // falling through to normal resolution. const requests = ["./index", "./target/a", "./target/b", "./target/c"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( `huge-alias-miss: ${PARALLEL_ALIASES} aliases, no match`, async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/000077500000000000000000000000001523262174200247435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/000077500000000000000000000000001523262174200264315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/package.json000066400000000000000000000010541523262174200307170ustar00rootroot00000000000000{ "name": "imports-field-fixture", "version": "1.0.0", "imports": { "#utils": { "node": "./src/utils/node.js", "default": "./src/utils/default.js" }, "#config": { "development": "./src/config.dev.js", "production": "./src/config.prod.js", "default": "./src/config.default.js" }, "#features/*": { "import": "./src/features/*.mjs", "require": "./src/features/*.js", "default": "./src/features/*.js" }, "#lib/*.js": "./src/lib/*.js", "#constant": "./src/constant.js" } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/000077500000000000000000000000001523262174200272205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/config.default.js000066400000000000000000000000251523262174200324430ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/config.dev.js000066400000000000000000000000251523262174200315750ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/config.prod.js000066400000000000000000000000251523262174200317630ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/constant.js000066400000000000000000000000251523262174200314040ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/default.js000066400000000000000000000000251523262174200311770ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/features/000077500000000000000000000000001523262174200310365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/features/feat-a.js000066400000000000000000000000251523262174200325260ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/features/feat-a.mjs000066400000000000000000000000251523262174200327030ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/features/feat-b.js000066400000000000000000000000251523262174200325270ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/features/feat-b.mjs000066400000000000000000000000251523262174200327040ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/features/feat-c.js000066400000000000000000000000251523262174200325300ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/features/feat-c.mjs000066400000000000000000000000251523262174200327050ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/index.js000066400000000000000000000000251523262174200306620ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/lib/000077500000000000000000000000001523262174200277665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/lib/one.js000066400000000000000000000000251523262174200311020ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/lib/three.js000066400000000000000000000000251523262174200314300ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/lib/two.js000066400000000000000000000000251523262174200311320ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/node.js000066400000000000000000000000251523262174200305000ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/polyfill.js000066400000000000000000000000251523262174200314050ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/utils/000077500000000000000000000000001523262174200303605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/utils/default.js000066400000000000000000000000251523262174200323370ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/fixture/src/utils/node.js000066400000000000000000000000251523262174200316400ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/imports-field/index.bench.mjs000066400000000000000000000030351523262174200276440ustar00rootroot00000000000000/* * imports-field * * Exercises the ImportsFieldPlugin (package-internal `#` specifiers) with: * - plain conditional imports (#utils, #config, #polyfill) * - pattern imports (#features/*, #lib/*.js) * - plain string mappings (#constant) * * Resolves `#...` requests from a source file inside the fixture, so the * resolver has to walk up to find package.json, then re-enter the imports * resolution pipeline. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], conditionNames: ["node", "require", "development"], }); const from = path.join(fixtureDir, "src"); const requests = [ "#utils", "#config", "#constant", "#features/feat-a", "#features/feat-b", "#features/feat-c", "#lib/one.js", "#lib/two.js", "#lib/three.js", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("imports-field: # specifiers (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/000077500000000000000000000000001523262174200253175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/000077500000000000000000000000001523262174200270055ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/package.json000066400000000000000000000000661523262174200312750ustar00rootroot00000000000000{"name":"large-alias-list-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/000077500000000000000000000000001523262174200275745ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/index.js000066400000000000000000000000251523262174200312360ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/000077500000000000000000000000001523262174200310625ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/a.js000066400000000000000000000000251523262174200316350ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/b.js000066400000000000000000000000251523262174200316360ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/c.js000066400000000000000000000000251523262174200316370ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/d.js000066400000000000000000000000251523262174200316400ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/e.js000066400000000000000000000000251523262174200316410ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/f.js000066400000000000000000000000251523262174200316420ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/g.js000066400000000000000000000000251523262174200316430ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/fixture/src/target/h.js000066400000000000000000000000251523262174200316440ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/large-alias-list/index.bench.mjs000066400000000000000000000040641523262174200302230ustar00rootroot00000000000000/* * large-alias-list * * Unlike `alias-realistic` (5 aliases) and `pathological-deep-stack` (50 * aliases forming a chain), this case configures 50 parallel aliases where * most don't match the current request. Measures the cost of AliasPlugin's * linear scan through unmatched entries — the common shape for projects * with a lot of alias rewrites in their webpack config. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const PARALLEL_ALIASES = 50; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); // 50 non-matching aliases + a handful that actually resolve. Every // request has to walk through the full list because AliasPlugin stops // on the first match. const aliases = []; for (let i = 0; i < PARALLEL_ALIASES; i++) { aliases.push({ name: `unused-alias-${i}`, alias: path.join(fixtureDir, "src/target/a.js"), }); } for (const fixture of ["a", "b", "c", "d", "e", "f", "g", "h"]) { aliases.push({ name: `t-${fixture}`, alias: path.join(fixtureDir, `src/target/${fixture}.js`), }); } const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: aliases, }); const from = path.join(fixtureDir, "src"); // Requests that hit aliases at the end of the list (after the 50 // non-matching ones) so each resolve walks the whole array. const requests = ["t-a", "t-b", "t-c", "t-d", "t-e", "t-f", "t-g", "t-h"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( `large-alias-list: ${PARALLEL_ALIASES}+8 aliases, match near end`, async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/000077500000000000000000000000001523262174200241725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/000077500000000000000000000000001523262174200256605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/000077500000000000000000000000001523262174200303355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-all/000077500000000000000000000000001523262174200316645ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-all/browser.js000066400000000000000000000000251523262174200337020ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-all/main.js000066400000000000000000000000251523262174200331430ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-all/module.js000066400000000000000000000000251523262174200335040ustar00rootroot00000000000000module.exports = {}; package.json000066400000000000000000000001501523262174200340670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-all{"name":"pkg-all","version":"1.0.0","module":"./module.js","browser":"./browser.js","main":"./main.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-browser/000077500000000000000000000000001523262174200325775ustar00rootroot00000000000000browser.js000066400000000000000000000000251523262174200345360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-browsermodule.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-browser/main.js000066400000000000000000000000251523262174200340560ustar00rootroot00000000000000module.exports = {}; module.js000066400000000000000000000000251523262174200343400ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-browsermodule.exports = {}; package.json000066400000000000000000000001251523262174200350040ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-browser{"name":"pkg-browser","version":"1.0.0","browser":"./browser.js","main":"./main.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-main/000077500000000000000000000000001523262174200320405ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-main/browser.js000066400000000000000000000000251523262174200340560ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-main/main.js000066400000000000000000000000251523262174200333170ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-main/module.js000066400000000000000000000000251523262174200336600ustar00rootroot00000000000000module.exports = {}; package.json000066400000000000000000000000711523262174200342450ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-main{"name":"pkg-main","version":"1.0.0","main":"./main.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-module/000077500000000000000000000000001523262174200324015ustar00rootroot00000000000000browser.js000066400000000000000000000000251523262174200343400ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-modulemodule.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-module/main.js000066400000000000000000000000251523262174200336600ustar00rootroot00000000000000module.exports = {}; module.js000066400000000000000000000000251523262174200341420ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-modulemodule.exports = {}; package.json000066400000000000000000000001221523262174200346030ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/node_modules/pkg-module{"name":"pkg-module","version":"1.0.0","module":"./module.js","main":"./main.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/fixture/package.json000066400000000000000000000000601523262174200301420ustar00rootroot00000000000000{"name":"main-field-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-field/index.bench.mjs000066400000000000000000000023601523262174200270730ustar00rootroot00000000000000/* * main-field * * Exercises MainFieldPlugin with multiple main field candidates * (`browser`, `module`, `main`) against four packages that define * different combinations of those fields, so every MainFieldPlugin * instance in the pipeline has a chance to hit or miss. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], mainFields: ["browser", "module", "main"], }); const from = fixtureDir; const requests = ["pkg-main", "pkg-module", "pkg-browser", "pkg-all"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("main-field: browser/module/main combos (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/000077500000000000000000000000001523262174200242115ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/000077500000000000000000000000001523262174200256775ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/package.json000066400000000000000000000000601523262174200301610ustar00rootroot00000000000000{"name":"main-files-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/src/000077500000000000000000000000001523262174200264665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/src/dir-a/000077500000000000000000000000001523262174200274625ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/src/dir-a/main.js000066400000000000000000000000251523262174200307410ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/src/dir-b/000077500000000000000000000000001523262174200274635ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/src/dir-b/entry.js000066400000000000000000000000251523262174200311570ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/src/dir-c/000077500000000000000000000000001523262174200274645ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/fixture/src/dir-c/index.js000066400000000000000000000000251523262174200311260ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/main-files/index.bench.mjs000066400000000000000000000026001523262174200271070ustar00rootroot00000000000000/* * main-files * * Custom `mainFiles` list (beyond the default `index`) — useful for * projects that ship directories with `main.js`, `entry.js`, etc. The * UseFilePlugin tries each entry in order, so a request that matches the * last entry walks through every earlier one first. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], mainFiles: ["main", "entry", "index"], }); const from = path.join(fixtureDir, "src"); // Each dir provides a different entry file, so every candidate in the // mainFiles list gets hit across the batch. const requests = ["./dir-a", "./dir-b", "./dir-c"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("main-files: [main, entry, index] (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/000077500000000000000000000000001523262174200262775ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/000077500000000000000000000000001523262174200277655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/package.json000066400000000000000000000000721523262174200322520ustar00rootroot00000000000000{"name":"many-extensions-miss-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/src/000077500000000000000000000000001523262174200305545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/src/a.json000066400000000000000000000000031523262174200316600ustar00rootroot00000000000000{} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/src/b.json000066400000000000000000000000031523262174200316610ustar00rootroot00000000000000{} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/src/c.json000066400000000000000000000000031523262174200316620ustar00rootroot00000000000000{} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/src/d.json000066400000000000000000000000031523262174200316630ustar00rootroot00000000000000{} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/src/e.json000066400000000000000000000000031523262174200316640ustar00rootroot00000000000000{} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/fixture/src/f.json000066400000000000000000000000031523262174200316650ustar00rootroot00000000000000{} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/many-extensions-miss/index.bench.mjs000066400000000000000000000031031523262174200311740ustar00rootroot00000000000000/* * many-extensions-miss * * Every request has its file stored only under the *last* candidate * extension. The resolver must probe (and fail) each earlier extension * first — 5 misses per resolve for a 6-extension list — before hitting * the right one. This is the worst-case shape for the AppendPlugin * chain and is a good regression sentinel for anything that might * change the cost of a failed FileExistsPlugin check. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, // .json is last so every resolve has to try .ts, .tsx, .mjs, .js, .jsx // and fail before landing on the right extension. extensions: [".ts", ".tsx", ".mjs", ".js", ".jsx", ".json"], }); const from = path.join(fixtureDir, "src"); const requests = ["./a", "./b", "./c", "./d", "./e", "./f"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "many-extensions-miss: 5 misses + 1 hit per resolve (warm)", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/000077500000000000000000000000001523262174200254425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/000077500000000000000000000000001523262174200271305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/000077500000000000000000000000001523262174200316055ustar00rootroot00000000000000conditional-pkg/000077500000000000000000000000001523262174200346105ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modulesdist/000077500000000000000000000000001523262174200355535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkgbrowser.dev.js000066400000000000000000000000251523262174200403460ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; browser.js000066400000000000000000000000251523262174200375710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; browser.prod.js000066400000000000000000000000251523262174200405340ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; index.d.ts000066400000000000000000000000251523262174200374510ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; index.js000066400000000000000000000000251523262174200372150ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; node.cjs000066400000000000000000000000251523262174200371760ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; node.dev.js000066400000000000000000000000251523262174200376100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; node.js000066400000000000000000000000251523262174200370330ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; node.mjs000066400000000000000000000000251523262174200372100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; node.prod.js000066400000000000000000000000251523262174200377760ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; rn.js000066400000000000000000000000251523262174200365250ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; worker.cjs000066400000000000000000000000251523262174200375620ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; worker.mjs000066400000000000000000000000251523262174200375740ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg/distmodule.exports = {}; package.json000066400000000000000000000012661523262174200371030ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/node_modules/conditional-pkg{ "name": "conditional-pkg", "version": "1.0.0", "exports": { ".": { "types": "./dist/index.d.ts", "worker": { "import": "./dist/worker.mjs", "require": "./dist/worker.cjs" }, "browser": { "development": "./dist/browser.dev.js", "production": "./dist/browser.prod.js", "default": "./dist/browser.js" }, "react-native": "./dist/rn.js", "node": { "development": "./dist/node.dev.js", "production": "./dist/node.prod.js", "import": "./dist/node.mjs", "require": "./dist/node.cjs", "default": "./dist/node.js" }, "default": "./dist/index.js" } } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/fixture/package.json000066400000000000000000000000661523262174200314200ustar00rootroot00000000000000{"name":"mixed-conditions-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/mixed-conditions/index.bench.mjs000066400000000000000000000034771523262174200303550ustar00rootroot00000000000000/* * mixed-conditions * * Stress the exports-field condition matcher with a deeply nested * condition map (browser/development/production, node/import/require, * worker, react-native, types, default) resolved under four different * `conditionNames` configurations. Each resolver hits a different branch * of the condition tree, so together they exercise the condition walker. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** @typedef {import("../../../types").Resolver} Resolver */ /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); /** * @param {string[]} conditionNames condition names * @returns {Resolver} resolver */ const makeResolver = (conditionNames) => ResolverFactory.createResolver({ fileSystem, extensions: [".js"], conditionNames, }); const resolvers = [ makeResolver(["node", "require", "production"]), makeResolver(["node", "import", "development"]), makeResolver(["browser", "production"]), makeResolver(["worker", "import"]), ]; const from = fixtureDir; const request = "conditional-pkg"; const resolve = (resolver) => new Promise((resolve, reject) => { resolver.resolve({}, from, request, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error("no result")); resolve(result); }); }); bench.add( "mixed-conditions: 4 condition sets against nested exports", async () => { // Rotate through each resolver configuration so every condition // branch gets exercised in a single iteration. for (const resolver of resolvers) { await resolve(resolver); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/000077500000000000000000000000001523262174200261355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/000077500000000000000000000000001523262174200276235ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/000077500000000000000000000000001523262174200323005ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-a/000077500000000000000000000000001523262174200332775ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346600ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-amodule.exports = "pkg-a"; package.json000066400000000000000000000000431523262174200355030ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-a{"name":"pkg-a","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-b/000077500000000000000000000000001523262174200333005ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346610ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-bmodule.exports = "pkg-b"; package.json000066400000000000000000000000431523262174200355040ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-b{"name":"pkg-b","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-c/000077500000000000000000000000001523262174200333015ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346620ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-cmodule.exports = "pkg-c"; package.json000066400000000000000000000000431523262174200355050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-c{"name":"pkg-c","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-d/000077500000000000000000000000001523262174200333025ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346630ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-dmodule.exports = "pkg-d"; package.json000066400000000000000000000000431523262174200355060ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-d{"name":"pkg-d","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-e/000077500000000000000000000000001523262174200333035ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346640ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-emodule.exports = "pkg-e"; package.json000066400000000000000000000000431523262174200355070ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-e{"name":"pkg-e","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-f/000077500000000000000000000000001523262174200333045ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-fmodule.exports = "pkg-f"; package.json000066400000000000000000000000431523262174200355100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-f{"name":"pkg-f","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-g/000077500000000000000000000000001523262174200333055ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346660ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-gmodule.exports = "pkg-g"; package.json000066400000000000000000000000431523262174200355110ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-g{"name":"pkg-g","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-h/000077500000000000000000000000001523262174200333065ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-hmodule.exports = "pkg-h"; package.json000066400000000000000000000000431523262174200355120ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/node_modules/pkg-h{"name":"pkg-h","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/package.json000066400000000000000000000000721523262174200321100ustar00rootroot00000000000000{"name":"modules-addrs-cached-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/000077500000000000000000000000001523262174200304125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/000077500000000000000000000000001523262174200306325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/000077500000000000000000000000001523262174200310535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/c/000077500000000000000000000000001523262174200312755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/c/d/000077500000000000000000000000001523262174200315205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/c/d/e/000077500000000000000000000000001523262174200317445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/c/d/e/f/000077500000000000000000000000001523262174200321715ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/c/d/e/f/g/000077500000000000000000000000001523262174200324175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/c/d/e/f/g/h/000077500000000000000000000000001523262174200326465ustar00rootroot00000000000000deep.js000066400000000000000000000000251523262174200340370ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/fixture/src/a/b/c/d/e/f/g/hmodule.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-addrs-cached/index.bench.mjs000066400000000000000000000037271523262174200310460ustar00rootroot00000000000000/* * modules-addrs-cached * * Exercises the per-directories `addrs` cache in `ModulesUtils`. The * resolver is asked to resolve 8 different bare specifiers (pkg-a … pkg-h) * from the *same* 8-deep source directory. For each resolve the module * plugin has to expand the 9 ancestor directories × 1 `node_modules` * directory into a flat 9-entry `addrs` list. Without caching every resolve * re-computes `getPaths()` + `join()` for the same input; with caching the * full fan-out is built once and reused for every subsequent resolve from * the same directory. * * This is the common shape of real-world builds: one entry file triggers * many bare-specifier lookups, and webpack / Next-style monorepos have * deep source directories. Small per-resolve wins compound quickly there. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 30 * 1000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); const deep = path.join(fixtureDir, "src/a/b/c/d/e/f/g/h"); // All resolves share the same starting directory → the addrs cache // hits on 7/8 requests per iteration after the first (warmup) pass. const requests = [ "pkg-a", "pkg-b", "pkg-c", "pkg-d", "pkg-e", "pkg-f", "pkg-g", "pkg-h", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, deep, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "modules-addrs-cached: 8 bare resolves from one 8-deep dir", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/000077500000000000000000000000001523262174200256545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/000077500000000000000000000000001523262174200273425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/node_modules/000077500000000000000000000000001523262174200320175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/node_modules/shared-dep/000077500000000000000000000000001523262174200340335ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200354160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/node_modules/shared-depmodule.exports = {}; package.json000066400000000000000000000000721523262174200362410ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/node_modules/shared-dep{"name":"shared-dep","version":"1.0.0","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/package.json000066400000000000000000000000771523262174200316340ustar00rootroot00000000000000{ "name": "modules-flat-addrs-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/packages/000077500000000000000000000000001523262174200311205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/packages/pkg-dep/000077500000000000000000000000001523262174200324475ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200340320ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/packages/pkg-depmodule.exports = {}; package.json000066400000000000000000000000671523262174200346610ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/packages/pkg-dep{"name":"pkg-dep","version":"1.0.0","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/shared-libs/000077500000000000000000000000001523262174200315375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/shared-libs/lib-dep/000077500000000000000000000000001523262174200330535ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200344360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/shared-libs/lib-depmodule.exports = {}; package.json000066400000000000000000000000671523262174200352650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/shared-libs/lib-dep{"name":"lib-dep","version":"1.0.0","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/000077500000000000000000000000001523262174200301315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/000077500000000000000000000000001523262174200303515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/000077500000000000000000000000001523262174200305725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/c/000077500000000000000000000000001523262174200310145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/c/d/000077500000000000000000000000001523262174200312375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/c/d/e/000077500000000000000000000000001523262174200314635ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/c/d/e/f/000077500000000000000000000000001523262174200317105ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/c/d/e/f/g/000077500000000000000000000000001523262174200321365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/c/d/e/f/g/h/000077500000000000000000000000001523262174200323655ustar00rootroot00000000000000leaf.js000066400000000000000000000000251523262174200335500ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/src/a/b/c/d/e/f/g/hmodule.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/vendor/000077500000000000000000000000001523262174200306375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/vendor/vendor-dep/000077500000000000000000000000001523262174200327025ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200342650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/vendor/vendor-depmodule.exports = {}; package.json000066400000000000000000000000721523262174200351100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/fixture/vendor/vendor-dep{"name":"vendor-dep","version":"1.0.0","main":"index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/modules-flat-addrs/index.bench.mjs000066400000000000000000000032001523262174200305470ustar00rootroot00000000000000/* * modules-flat-addrs * * Exercises `ModulesUtils.modulesResolveHandler` with an 8-deep source * directory × 4-entry `modules` list. The plugin fans out every ancestor * directory × every configured modules dir into one flat `addrs` array * and stats each. Previously that flat list was produced by `map` then * `reduce(...)`; the current implementation pre-sizes the array and * fills it in-place. This bench sets N_ancestors = 9 × N_modules = 4 = * 36 addrs per request and runs five bare-specifier resolves per * iteration so the fan-out step dominates. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], modules: ["shared-libs", "packages", "vendor", "node_modules"], }); const deep = path.join(fixtureDir, "src/a/b/c/d/e/f/g/h"); const requests = ["shared-dep", "vendor-dep", "pkg-dep", "lib-dep"]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, deep, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "modules-flat-addrs: 8-deep dir × 4 modules, 4 bare resolves", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/000077500000000000000000000000001523262174200254665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/000077500000000000000000000000001523262174200271545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/node_modules/000077500000000000000000000000001523262174200316315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/node_modules/pkg-x/000077500000000000000000000000001523262174200326575ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200342420ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/node_modules/pkg-xmodule.exports = {}; package.json000066400000000000000000000000671523262174200350710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/node_modules/pkg-x{"name":"pkg-x","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/package.json000066400000000000000000000000661523262174200314440ustar00rootroot00000000000000{"name":"multiple-modules-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/shared/000077500000000000000000000000001523262174200304225ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/shared/app-one/000077500000000000000000000000001523262174200317615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/shared/app-one/index.js000066400000000000000000000000251523262174200334230ustar00rootroot00000000000000module.exports = {}; package.json000066400000000000000000000000711523262174200341660ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/shared/app-one{"name":"app-one","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/shared/app-two/000077500000000000000000000000001523262174200320115ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/shared/app-two/index.js000066400000000000000000000000251523262174200334530ustar00rootroot00000000000000module.exports = {}; package.json000066400000000000000000000000711523262174200342160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/shared/app-two{"name":"app-two","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/src/000077500000000000000000000000001523262174200277435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/src/index.js000066400000000000000000000000251523262174200314050ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/vendor/000077500000000000000000000000001523262174200304515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/vendor/vendor-a/000077500000000000000000000000001523262174200321645ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/vendor/vendor-a/index.js000066400000000000000000000000251523262174200336260ustar00rootroot00000000000000module.exports = {}; package.json000066400000000000000000000000721523262174200343720ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/fixture/vendor/vendor-a{"name":"vendor-a","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/multiple-modules/index.bench.mjs000066400000000000000000000031441523262174200303700ustar00rootroot00000000000000/* * multiple-modules * * Exercises `modules: [...]` with a mix of relative (hierarchical) and * absolute (root) directories. Each entry spawns either a * `ModulesInHierarchicalDirectoriesPlugin` or a `ModulesInRootPlugin`, * and every bare specifier has to walk all of them in order until it * finds a match. Common pattern in monorepos with `shared/` or `libs/` * directories next to `node_modules`. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], modules: [ path.join(fixtureDir, "shared"), path.join(fixtureDir, "vendor"), "node_modules", ], }); const from = path.join(fixtureDir, "src"); const requests = [ "app-one", // hits shared/ "app-two", // hits shared/ "vendor-a", // hits vendor/ "pkg-x", // hits node_modules (after walking shared + vendor first) ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "multiple-modules: shared + vendor + node_modules (warm)", async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/node-compare/000077500000000000000000000000001523262174200245365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/node-compare/fixture/000077500000000000000000000000001523262174200262245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/node-compare/fixture/.gitignore000066400000000000000000000000161523262174200302110ustar00rootroot00000000000000* !.gitignore webpack-enhanced-resolve-7dfc9bc/benchmark/cases/node-compare/index.bench.mjs000066400000000000000000000311241523262174200274370ustar00rootroot00000000000000/* * node-compare * * Head-to-head comparison between enhanced-resolve and Node.js's built-in * resolvers (CJS `require.resolve` via `createRequire`, ESM * `import.meta.resolve`) over a large, fixed request list (10000 resolves * per iteration). This is the case people most often ask about when * deciding whether enhanced-resolve's feature set is "worth it" over the * built-in resolvers — so it lives as its own bench for easy * cross-reference. * * Everything is held equal across tasks: * - Same fixture tree * - Same 10000-entry request list (one entry per unique target, see below) * - Same starting directory * * The enhanced-resolve side is benched in three variants per API flavour * so the contribution of each caching layer is visible: * - `(no cache)` — `CachedInputFileSystem` constructed with * `duration: 0`, which routes through `OperationMergerBackend` * instead of `CacheBackend` and does no stat/readdir/readJson * memoization (see `lib/CachedInputFileSystem.js:527-532`). No * `unsafeCache` either. Real pipeline work AND real fs work on every * call. * - `(fs cache)` — `CachedInputFileSystem` with a 30s TTL so stat / * readdir / readJson are memoized in memory. Mirrors the OS-level fs * cache Node itself relies on, but does NOT cache the * specifier → path mapping. * - `(fs + unsafeCache)` — adds `unsafeCache: true`, the closest * analogue to Node's per-specifier memoization (Module._pathCache for * CJS, the ESM loader cache for `import.meta.resolve`). * * The request list is *unique-per-entry* — every specifier in the 10000- * request batch points at a distinct resolvable target. This defeats the * per-specifier result caches within a single batch, so even with * `unsafeCache` on the first pass through the list must run the full * resolver pipeline for every entry. Subsequent tinybench iterations * replay the list, at which point Node's internal caches and * enhanced-resolve's `unsafeCache` / fs cache start hitting — which is * exactly what the cached variants are there to illustrate. * * Cross-iteration caching is unavoidable: tinybench replays the same * request list across 2 warmup + 10 measurement iterations, and the * first run through populates Node's internal caches for the whole * list. Read the numbers as "steady-state warm, cache cannot help" * rather than truly cold. * * Pool composition (all 10000 entries unique, ESM-compatible so they * resolve in every task): * - 5000 bare specifiers into a single package with wildcard subpath * exports (`megapkg/fileNNNN` → `megapkg/lib/fileNNNN.js`). A single * package with wildcard exports keeps the fixture size small while * still exercising the `exports` field / `node_modules` lookup path. * - 5000 relative specifiers with explicit `.js` extensions (`./fileNNNN.js`) * so Node's ESM resolver accepts them; enhanced-resolve is happy with * them too. * * The fixture is generated at registration time (one `megapkg` with 5000 * lib files + 5000 src files + one ESM helper for the bound * `import.meta.resolve`) and gitignored. A sentinel file skips * regeneration when counts haven't changed, so only the first run pays * the setup cost. */ import fs from "fs"; import { createRequire } from "module"; import path from "path"; import { pathToFileURL } from "url"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const PKG_SUBPATH_COUNT = 500; const FILE_COUNT = 500; const BATCH_SIZE = PKG_SUBPATH_COUNT + FILE_COUNT; /* * Build a deterministic fixture tree on disk. Skipped entirely when a * sentinel file records that the current (PKG_SUBPATH_COUNT, FILE_COUNT) * combination has already been materialized — creating 10k tiny files is * a ~5s cost we don't want to pay every `npm run benchmark`. * * Layout: * fixture/ * package.json // type: commonjs * src/ * resolver.mjs // exports `import.meta.resolve` * file0000.js .. file4999.js // relative-resolve targets * node_modules/megapkg/ * package.json // wildcard subpath exports * lib/ * file0000.js .. file4999.js // bare-specifier targets */ /** * @param {string} fixtureDir fixture dir */ function ensureFixture(fixtureDir) { const sentinel = path.join(fixtureDir, ".ok"); const expected = `${PKG_SUBPATH_COUNT}:${FILE_COUNT}`; try { if (fs.readFileSync(sentinel, "utf8") === expected) return; } catch { // sentinel missing or unreadable — regenerate } fs.mkdirSync(fixtureDir, { recursive: true }); fs.writeFileSync( path.join(fixtureDir, "package.json"), JSON.stringify({ name: "node-compare-fixture", version: "1.0.0", type: "commonjs", }), ); const srcDir = path.join(fixtureDir, "src"); fs.mkdirSync(srcDir, { recursive: true }); // ESM helper: `import.meta.resolve` is a bound method that closes over // its owning module's URL, so we need a module that actually lives in // the fixture tree. Exporting the bound function lets the bench body // call it and have relative + bare specifiers resolved against this // module's location. fs.writeFileSync( path.join(srcDir, "resolver.mjs"), "export const resolve = import.meta.resolve;\n", ); for (let i = 0; i < FILE_COUNT; i++) { const name = `file${String(i).padStart(4, "0")}`; fs.writeFileSync( path.join(srcDir, `${name}.js`), `module.exports = ${i};\n`, ); } const megapkgDir = path.join(fixtureDir, "node_modules", "megapkg"); const megapkgLibDir = path.join(megapkgDir, "lib"); fs.mkdirSync(megapkgLibDir, { recursive: true }); // Wildcard subpath exports: `megapkg/fileNNNN` → `./lib/fileNNNN.js`. // Supported by both Node's CJS + ESM resolvers and enhanced-resolve. fs.writeFileSync( path.join(megapkgDir, "package.json"), JSON.stringify({ name: "megapkg", version: "1.0.0", exports: { "./*": "./lib/*.js", }, }), ); for (let i = 0; i < PKG_SUBPATH_COUNT; i++) { const name = `file${String(i).padStart(4, "0")}`; fs.writeFileSync( path.join(megapkgLibDir, `${name}.js`), `module.exports = ${JSON.stringify(name)};\n`, ); } fs.writeFileSync(sentinel, expected); } /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default async function register(bench, { fixtureDir }) { ensureFixture(fixtureDir); const srcDir = path.join(fixtureDir, "src"); // Build the 10000-entry request list. All specifiers are unique so the // per-specifier result caches in Node's CJS and ESM resolvers (and // enhanced-resolve's `unsafeCache` if we'd enabled it) cannot // short-circuit anything within a single batch. const requests = Array.from({ length: BATCH_SIZE }); for (let i = 0; i < PKG_SUBPATH_COUNT; i++) { requests[i] = `megapkg/file${String(i).padStart(4, "0")}`; } for (let i = 0; i < FILE_COUNT; i++) { requests[PKG_SUBPATH_COUNT + i] = `./file${String(i).padStart(4, "0")}.js`; } // Node's `require.resolve` is anchored to a real file inside `src/` so // relative specifiers resolve against that directory, and bare // specifiers walk up the `node_modules` lookup chain. const requireAnchor = createRequire(path.join(srcDir, "index.js")); // `import.meta.resolve` is bound to its module's URL, so import the // helper we wrote into `fixture/src/resolver.mjs` and use its exported // `resolve`. Relative specifiers will resolve against `fixture/src/`, // matching the CJS anchor above. const { resolve: importMetaResolve } = await import( pathToFileURL(path.join(srcDir, "resolver.mjs")).href ); // Two filesystem wrappers: // - raw: duration 0 → OperationMergerBackend, no stat/readdir cache // - cached: 30s TTL is long enough that entries never expire during // a bench run const rawFileSystem = new CachedInputFileSystem(fs, 0); const fileSystem = new CachedInputFileSystem(fs, 30 * 1000); const baseOptions = { extensions: [".js"], conditionNames: ["node", "require", "import"], mainFields: ["main"], }; // Three resolver configs per API flavour: no cache / fs cache / fs + // unsafeCache. Each flavour gets its own factory call so tinybench // measures independent V8 inline-cache state per task. const asyncResolverNone = ResolverFactory.createResolver({ ...baseOptions, fileSystem: rawFileSystem, }); const asyncResolverFs = ResolverFactory.createResolver({ ...baseOptions, fileSystem, }); const asyncResolverFsUnsafe = ResolverFactory.createResolver({ ...baseOptions, fileSystem, unsafeCache: true, }); const syncResolverNone = ResolverFactory.createResolver({ ...baseOptions, fileSystem: rawFileSystem, useSyncFileSystemCalls: true, }); const syncResolverFs = ResolverFactory.createResolver({ ...baseOptions, fileSystem, useSyncFileSystemCalls: true, }); const syncResolverFsUnsafe = ResolverFactory.createResolver({ ...baseOptions, fileSystem, useSyncFileSystemCalls: true, unsafeCache: true, }); const resolveAsync = (resolver, req) => new Promise((resolve, reject) => { resolver.resolve({}, srcDir, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); // --- async (callback API, wrapped in a Promise) --- bench.add( `node-compare: enhanced-resolve async x ${BATCH_SIZE} (no cache)`, async () => { for (let i = 0; i < requests.length; i++) { await resolveAsync(asyncResolverNone, requests[i]); } }, ); bench.add( `node-compare: enhanced-resolve async x ${BATCH_SIZE} (fs cache)`, async () => { for (let i = 0; i < requests.length; i++) { await resolveAsync(asyncResolverFs, requests[i]); } }, ); bench.add( `node-compare: enhanced-resolve async x ${BATCH_SIZE} (fs + unsafeCache)`, async () => { for (let i = 0; i < requests.length; i++) { await resolveAsync(asyncResolverFsUnsafe, requests[i]); } }, ); // --- promise API (resolver.resolvePromise) --- // Functionally equivalent to the callback task wrapped in a new // Promise — benched separately so the overhead (or lack thereof) of // the built-in promise wrapper vs a hand-rolled one is visible. bench.add( `node-compare: enhanced-resolve promise x ${BATCH_SIZE} (no cache)`, async () => { for (let i = 0; i < requests.length; i++) { const r = await asyncResolverNone.resolvePromise( {}, srcDir, requests[i], ); if (!r) throw new Error(`no result for ${requests[i]}`); } }, ); bench.add( `node-compare: enhanced-resolve promise x ${BATCH_SIZE} (fs cache)`, async () => { for (let i = 0; i < requests.length; i++) { const r = await asyncResolverFs.resolvePromise({}, srcDir, requests[i]); if (!r) throw new Error(`no result for ${requests[i]}`); } }, ); bench.add( `node-compare: enhanced-resolve promise x ${BATCH_SIZE} (fs + unsafeCache)`, async () => { for (let i = 0; i < requests.length; i++) { const r = await asyncResolverFsUnsafe.resolvePromise( {}, srcDir, requests[i], ); if (!r) throw new Error(`no result for ${requests[i]}`); } }, ); // --- sync API (resolveSync, useSyncFileSystemCalls: true) --- bench.add( `node-compare: enhanced-resolve sync x ${BATCH_SIZE} (no cache)`, () => { for (let i = 0; i < requests.length; i++) { const r = syncResolverNone.resolveSync({}, srcDir, requests[i]); if (!r) throw new Error(`no result for ${requests[i]}`); } }, ); bench.add( `node-compare: enhanced-resolve sync x ${BATCH_SIZE} (fs cache)`, () => { for (let i = 0; i < requests.length; i++) { const r = syncResolverFs.resolveSync({}, srcDir, requests[i]); if (!r) throw new Error(`no result for ${requests[i]}`); } }, ); bench.add( `node-compare: enhanced-resolve sync x ${BATCH_SIZE} (fs + unsafeCache)`, () => { for (let i = 0; i < requests.length; i++) { const r = syncResolverFsUnsafe.resolveSync({}, srcDir, requests[i]); if (!r) throw new Error(`no result for ${requests[i]}`); } }, ); bench.add(`node-compare: node require.resolve x ${BATCH_SIZE}`, () => { for (let i = 0; i < requests.length; i++) { requireAnchor.resolve(requests[i]); } }); // `import.meta.resolve` is sync in modern Node (>= 20.6 / 18.19). The // ESM loader keeps its own specifier cache; using unique specifiers // (see comment on `requests` above) keeps that cache from hiding the // real resolve cost on every call within a batch. bench.add(`node-compare: node import.meta.resolve x ${BATCH_SIZE}`, () => { for (let i = 0; i < requests.length; i++) { importMetaResolve(requests[i]); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/pathological-deep-stack/000077500000000000000000000000001523262174200266515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/pathological-deep-stack/fixture/000077500000000000000000000000001523262174200303375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/pathological-deep-stack/fixture/entry.js000066400000000000000000000000251523262174200320330ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/pathological-deep-stack/fixture/package.json000066400000000000000000000001061523262174200326220ustar00rootroot00000000000000{ "name": "pathological-deep-stack-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/pathological-deep-stack/fixture/target.js000066400000000000000000000000331523262174200321570ustar00rootroot00000000000000module.exports = "target"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/pathological-deep-stack/index.bench.mjs000066400000000000000000000052071523262174200315550ustar00rootroot00000000000000/* * pathological-deep-stack * * Stress the doResolve recursion-check path specifically. Configures a long * chain of alias rewrites so every resolution of `chain-0` produces a stack * of depth O(N) before landing on `./target.js`. * * This is the case that the linked-list rewrite in PR #443 is most likely * to regress, because hasStackEntry walks the parent chain. Keeping the * number here high enough to matter (50+ levels) but low enough to finish * quickly is the point. * * If you're benchmarking the #443 PR, compare this case before and after: * - "before" (current main): Set clone per level, O(n) cost per * doResolve, O(n^2) per full chain, but cheap per-step comparison * - "after" (#443): single linked-list node per level, O(1) alloc, but * hasStackEntry walks parents -> O(n) per comparison, O(n^2) per chain * Both are quadratic on paper; the question is the constant factor and the * amount of GC pressure. That's exactly what this case measures. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const CHAIN_LENGTH = 50; /* * Build an AliasPlugin-compatible alias list that forms a chain: * chain-0 -> chain-1 -> chain-2 -> ... -> chain-49 -> ./target * * Each entry rewrites one specifier to the next, so a single resolve of * `chain-0` forces enhanced-resolve to re-enter the pipeline CHAIN_LENGTH * times before bottoming out. */ /** * @returns {string[]} aliases */ function buildChainAliases() { const aliases = []; for (let i = 0; i < CHAIN_LENGTH - 1; i++) { aliases.push({ name: `chain-${i}`, alias: `chain-${i + 1}` }); } aliases.push({ name: `chain-${CHAIN_LENGTH - 1}`, alias: "./target" }); return aliases; } /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const aliases = buildChainAliases(); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: aliases, }); const resolve = () => new Promise((resolve, reject) => { resolver.resolve({}, fixtureDir, "chain-0", {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error("no result")); resolve(result); }); }); bench.add( `pathological-deep-stack: alias chain of ${CHAIN_LENGTH} (warm)`, async () => { // 10 resolves per iteration so the bench body is long enough to be // measurable but short enough to finish quickly. for (let i = 0; i < 10; i++) { await resolve(); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/000077500000000000000000000000001523262174200252645ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/000077500000000000000000000000001523262174200267525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/000077500000000000000000000000001523262174200302545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/data/000077500000000000000000000000001523262174200311655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/data/config.js000066400000000000000000000000251523262174200327650ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/data/schema.js000066400000000000000000000000251523262174200327600ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/img/000077500000000000000000000000001523262174200310305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/img/hero.js000066400000000000000000000000251523262174200323200ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/img/icon.js000066400000000000000000000000251523262174200323130ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/assets/img/logo.js000066400000000000000000000000251523262174200323230ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/fixture/package.json000066400000000000000000000000651523262174200312410ustar00rootroot00000000000000{"name":"prefer-absolute-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-absolute/index.bench.mjs000066400000000000000000000033071523262174200301670ustar00rootroot00000000000000/* * prefer-absolute * * `preferAbsolute: true` makes the resolver try a server-relative (`/...`) * request as an absolute filesystem path before falling back to root- * resolution via RootsPlugin. Different code branch in the normal-resolve * hook than `preferRelative`, so worth a dedicated case. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], preferAbsolute: true, }); const from = fixtureDir; // Absolute paths that exist on disk (under the fixture root). const requests = [ path.join(fixtureDir, "assets/img/logo"), path.join(fixtureDir, "assets/img/hero"), path.join(fixtureDir, "assets/img/icon"), path.join(fixtureDir, "assets/data/config"), path.join(fixtureDir, "assets/data/schema"), ]; // Warm resolves allocate only a few KB, below CodSpeed's memory-mode noise // floor; repeat the batch so measured allocation clears it. const REPEAT = 20; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("prefer-absolute: absolute paths (warm)", async () => { for (let r = 0; r < REPEAT; r++) { for (const req of requests) { await resolve(req); } } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/000077500000000000000000000000001523262174200252615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/000077500000000000000000000000001523262174200267475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/node_modules/000077500000000000000000000000001523262174200314245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/node_modules/some-pkg/000077500000000000000000000000001523262174200331465ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200345310ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/node_modules/some-pkgmodule.exports = {}; package.json000066400000000000000000000000721523262174200353540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/node_modules/some-pkg{"name":"some-pkg","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/package.json000066400000000000000000000000651523262174200312360ustar00rootroot00000000000000{"name":"prefer-relative-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/src/000077500000000000000000000000001523262174200275365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/src/index.js000066400000000000000000000000251523262174200312000ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/src/local-a.js000066400000000000000000000000251523262174200314010ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/src/local-b.js000066400000000000000000000000251523262174200314020ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/fixture/src/local-c.js000066400000000000000000000000251523262174200314030ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/prefer-relative/index.bench.mjs000066400000000000000000000024601523262174200301630ustar00rootroot00000000000000/* * prefer-relative * * With `preferRelative: true`, a bare specifier like `local-a` is first * tried as `./local-a` before falling back to the module lookup. Every * request therefore runs an extra JoinRequestPlugin attempt, which is the * workload we want to measure here. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], preferRelative: true, }); const from = path.join(fixtureDir, "src"); const requests = [ "local-a", "local-b", "local-c", "some-pkg", // hits the fallback to node_modules ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("prefer-relative: bare-as-relative (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/000077500000000000000000000000001523262174200251335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/fixture/000077500000000000000000000000001523262174200266215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/fixture/package.json000066400000000000000000000000641523262174200311070ustar00rootroot00000000000000{"name":"query-fragment-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/fixture/src/000077500000000000000000000000001523262174200274105ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/fixture/src/component.js000066400000000000000000000000251523262174200317450ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/fixture/src/style.js000066400000000000000000000000251523262174200311030ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/fixture/src/util.js000066400000000000000000000000251523262174200307200ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/query-fragment/index.bench.mjs000066400000000000000000000030031523262174200300270ustar00rootroot00000000000000/* * query-fragment * * Webpack loaders attach `?query` and `#fragment` to requests (for e.g. * `import x from "./foo.vue?vue&type=style"`), and the ParsePlugin has * to split these apart before kicking off resolution, then reattach them * to the final result. This case fires requests that exercise all four * combinations (plain, ?query, #fragment, ?query#fragment) so the parser * split/join path is hot. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); const from = path.join(fixtureDir, "src"); const requests = [ "./style", "./style?scoped", "./style#fragment", "./style?mode=dev#legacy", "./component", "./component?lang=ts", "./component#name", "./util?k=1&v=2", "./util?x=1#y", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("query-fragment: ?query + #fragment mix (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/000077500000000000000000000000001523262174200256065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/000077500000000000000000000000001523262174200272745ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/000077500000000000000000000000001523262174200317515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/@scope/000077500000000000000000000000001523262174200331625ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/@scope/pkg/000077500000000000000000000000001523262174200337435ustar00rootroot00000000000000dist/000077500000000000000000000000001523262174200346275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/@scope/pkgindex.js000066400000000000000000000000251523262174200362710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/@scope/pkg/distmodule.exports = {}; sub.js000066400000000000000000000000251523262174200357530ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/@scope/pkg/distmodule.exports = {}; package.json000066400000000000000000000001761523262174200361560ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/@scope/pkg{ "name": "@scope/pkg", "version": "1.0.0", "exports": { ".": "./dist/index.js", "./sub": "./dist/sub.js" } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/debug/000077500000000000000000000000001523262174200330375ustar00rootroot00000000000000package.json000066400000000000000000000001101523262174200352360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/debug{ "name": "debug", "version": "4.3.0", "main": "./src/index.js" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/debug/src/000077500000000000000000000000001523262174200336265ustar00rootroot00000000000000index.js000066400000000000000000000000461523262174200352140ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/debug/srcmodule.exports = function debug() {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/lodash/000077500000000000000000000000001523262174200332235ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/lodash/lib/000077500000000000000000000000001523262174200337715ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200353540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/lodash/libmodule.exports = {}; map.js000066400000000000000000000000441523262174200350230ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/lodash/libmodule.exports = function map() {}; package.json000066400000000000000000000001121523262174200354240ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/lodash{ "name": "lodash", "version": "4.17.0", "main": "./lib/index.js" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/react/000077500000000000000000000000001523262174200330475ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200344320ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/reactmodule.exports = {}; jsx-runtime.js000066400000000000000000000000251523262174200356100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/reactmodule.exports = {}; package.json000066400000000000000000000003701523262174200352560ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/node_modules/react{ "name": "react", "version": "18.0.0", "main": "./index.js", "exports": { ".": { "require": "./index.js", "default": "./index.js" }, "./jsx-runtime": "./jsx-runtime.js", "./package.json": "./package.json" } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/package.json000066400000000000000000000001621523262174200315610ustar00rootroot00000000000000{ "name": "realistic-midsize-fixture", "version": "1.0.0", "type": "commonjs", "main": "./src/index.js" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/000077500000000000000000000000001523262174200300635ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/a/000077500000000000000000000000001523262174200303035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/a/a1.js000066400000000000000000000000241523262174200311360ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/a/a2.js000066400000000000000000000000241523262174200311370ustar00rootroot00000000000000module.exports = 2; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/a/index.js000066400000000000000000000000251523262174200317450ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/000077500000000000000000000000001523262174200303045ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/index.js000066400000000000000000000000251523262174200317460ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/000077500000000000000000000000001523262174200315665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/deep/000077500000000000000000000000001523262174200325035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/deep/leaf.js000066400000000000000000000000311523262174200337420ustar00rootroot00000000000000module.exports = "leaf"; nested-pkg/000077500000000000000000000000001523262174200344655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/deepnode_modules/000077500000000000000000000000001523262174200371425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/deep/nested-pkgdebug/000077500000000000000000000000001523262174200402305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/deep/nested-pkg/node_modulesindex.js000066400000000000000000000000461523262174200416750ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/deep/nested-pkg/node_modules/debugmodule.exports = function debug() {}; package.json000066400000000000000000000001041523262174200425110ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/b/nested/deep/nested-pkg/node_modules/debug{ "name": "debug", "version": "3.0.0", "main": "./index.js" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/index.js000066400000000000000000000000251523262174200315250ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/fixture/src/utils.js000066400000000000000000000000251523262174200315560ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/realistic-midsize/index.bench.mjs000066400000000000000000000072461523262174200305170ustar00rootroot00000000000000/* * realistic-midsize * * A synthetic project tree meant to approximate the distribution of resolver * requests in a real-world medium-sized JS project: * - relative requests from deeply nested files * - bare-specifier lookups into node_modules with a `main` field * - bare-specifier lookups into a package with an `exports` map * - scoped packages * - nested node_modules (version collision between top-level and nested) * * The bench body runs one pass over a fixed request list per iteration, so * the reported number measures "average ops/s per full batch" — divide by * the batch length if you want per-resolve cost. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; // Long enough that cache entries never expire mid-run: tinybench's warmup + // measurement loop for this task runs for a couple of seconds at most, and // `CachedInputFileSystem`'s default 4s TTL was short enough that some stat // calls would re-enter fs mid-benchmark and add timing jitter (~5% rme). // // Capped at 30s because CachedInputFileSystem's constructor allocates one // Set per 500ms of TTL (see CacheBackend), and the cold-cache case rebuilds // that cache every iteration — so a very large TTL would shift the // benchmark into measuring cache construction instead of resolve work. const WARM_FS_CACHE_TTL_MS = 30 * 1000; const COLD_FS_CACHE_TTL_MS = 4000; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, WARM_FS_CACHE_TTL_MS); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js", ".json"], conditionNames: ["node", "require"], mainFields: ["main"], }); // (from-directory, request) pairs. Mix of relative, bare, scoped, deep. const srcA = path.join(fixtureDir, "src/a"); const srcBDeep = path.join(fixtureDir, "src/b/nested/deep"); const root = path.join(fixtureDir, "src"); const requests = [ [srcA, "./a1"], [srcA, "./a2"], [srcA, "../utils"], [srcA, "../b"], [srcA, "../b/nested/deep/leaf"], [root, "lodash"], [root, "lodash/lib/map"], [root, "react"], [root, "react/jsx-runtime"], [root, "@scope/pkg"], [root, "@scope/pkg/sub"], [root, "debug"], // Nested node_modules: resolved from deep inside src/b, should hit the // nested copy rather than the top-level one. [srcBDeep, "debug"], ]; const resolve = (context, request) => new Promise((resolve, reject) => { resolver.resolve({}, context, request, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${request}`)); resolve(result); }); }); bench.add("realistic-midsize: mixed batch (warm cache)", async () => { for (const [from, req] of requests) { await resolve(from, req); } }); // Same requests, but a fresh resolver (and fresh CachedInputFileSystem) per // iteration, so the fs cache never helps us. This is the metric that most // directly reflects the cost of the doResolve hot path itself. bench.add("realistic-midsize: mixed batch (cold cache)", async () => { const coldFs = new CachedInputFileSystem(fs, COLD_FS_CACHE_TTL_MS); const coldResolver = ResolverFactory.createResolver({ fileSystem: coldFs, extensions: [".js", ".json"], conditionNames: ["node", "require"], mainFields: ["main"], }); for (const [from, req] of requests) { await new Promise((resolve, reject) => { coldResolver.resolve({}, from, req, {}, (err) => { if (err) return reject(err); resolve(); }); }); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/000077500000000000000000000000001523262174200257465ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/000077500000000000000000000000001523262174200274345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/node_modules/000077500000000000000000000000001523262174200321115ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/node_modules/some-pkg/000077500000000000000000000000001523262174200336335ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200352160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/node_modules/some-pkgmodule.exports = {}; package.json000066400000000000000000000000461523262174200360420ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/node_modules/some-pkg{"name":"some-pkg","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/package.json000066400000000000000000000000701523262174200317170ustar00rootroot00000000000000{"name":"resolve-to-context-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/src/000077500000000000000000000000001523262174200302235ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/src/a/000077500000000000000000000000001523262174200304435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/src/a/index.js000066400000000000000000000000251523262174200321050ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/src/b/000077500000000000000000000000001523262174200304445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/src/b/index.js000066400000000000000000000000251523262174200321060ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/src/c/000077500000000000000000000000001523262174200304455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/fixture/src/c/index.js000066400000000000000000000000251523262174200321070ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/resolve-to-context/index.bench.mjs000066400000000000000000000024061523262174200306500ustar00rootroot00000000000000/* * resolve-to-context * * `resolveToContext: true` asks the resolver to return a directory rather * than a file, which takes a different branch through ResolverFactory * (skips the file/extension/mainField/raw-file plugins entirely). This * case measures that alternate pipeline. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], resolveToContext: true, }); const from = fixtureDir; const requests = [ "./src/a", "./src/b", "./src/c", "./src", "./node_modules/some-pkg", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("resolve-to-context: directory resolve (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/000077500000000000000000000000001523262174200247155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/000077500000000000000000000000001523262174200264035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/package.json000066400000000000000000000000731523262174200306710ustar00rootroot00000000000000{ "name": "restrictions-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/000077500000000000000000000000001523262174200271725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/allowed/000077500000000000000000000000001523262174200306215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/allowed/a.js000066400000000000000000000000251523262174200313740ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/allowed/b.js000066400000000000000000000000251523262174200313750ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/allowed/c.js000066400000000000000000000000251523262174200313760ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/allowed/d.js000066400000000000000000000000251523262174200313770ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/index.js000066400000000000000000000000251523262174200306340ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/other/000077500000000000000000000000001523262174200303135ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/other/e.js000066400000000000000000000000251523262174200310720ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/fixture/src/other/f.js000066400000000000000000000000251523262174200310730ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/restrictions/index.bench.mjs000066400000000000000000000026011523262174200276140ustar00rootroot00000000000000/* * restrictions * * Exercises the RestrictionsPlugin: every resolved path is checked against * a list of allowed-directory regexes / string prefixes before being * accepted. This runs on the `resolved` hook — on the critical path for * every successful resolve — so even a simple config adds work per request. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], restrictions: [path.join(fixtureDir, "src"), /\.js$/], }); const from = path.join(fixtureDir, "src"); const requests = [ "./allowed/a", "./allowed/b", "./allowed/c", "./allowed/d", "./other/e", "./other/f", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("restrictions: path prefix + regex (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/000077500000000000000000000000001523262174200233335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/000077500000000000000000000000001523262174200250215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/000077500000000000000000000000001523262174200263235ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/images/000077500000000000000000000000001523262174200275705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/images/banner.js000066400000000000000000000000061523262174200313670ustar00rootroot00000000000000/* */ webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/images/icon.js000066400000000000000000000000061523262174200310520ustar00rootroot00000000000000/* */ webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/images/logo.js000066400000000000000000000000061523262174200310620ustar00rootroot00000000000000/* */ webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/images/thumbnail.js000066400000000000000000000000061523262174200321050ustar00rootroot00000000000000/* */ webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/scripts/000077500000000000000000000000001523262174200300125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/scripts/helper.js000066400000000000000000000000251523262174200316240ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/scripts/main.js000066400000000000000000000000251523262174200312710ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/assets/scripts/vendor.js000066400000000000000000000000251523262174200316420ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/package.json000066400000000000000000000000641523262174200273070ustar00rootroot00000000000000{ "name": "roots-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/src/000077500000000000000000000000001523262174200256105ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/fixture/src/index.js000066400000000000000000000000251523262174200272520ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/roots/index.bench.mjs000066400000000000000000000025171523262174200262400ustar00rootroot00000000000000/* * roots * * Exercises RootsPlugin: requests starting with `/` are resolved against * one of the configured roots (common pattern in webpack loaders for * asset imports). The plugin has to try each root in order. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], roots: [fixtureDir], }); const from = path.join(fixtureDir, "src"); const requests = [ "/assets/images/logo", "/assets/images/banner", "/assets/images/icon", "/assets/images/thumbnail", "/assets/scripts/main", "/assets/scripts/helper", "/assets/scripts/vendor", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("roots: server-relative paths (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/000077500000000000000000000000001523262174200250525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/000077500000000000000000000000001523262174200265405ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/package.json000066400000000000000000000003251523262174200310260ustar00rootroot00000000000000{ "name": "self-ref-pkg", "version": "1.0.0", "exports": { ".": "./src/index.js", "./utils": "./src/utils.js", "./features/*": "./src/features/*.js", "./package.json": "./package.json" } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/000077500000000000000000000000001523262174200273275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/features/000077500000000000000000000000001523262174200311455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/features/four.js000066400000000000000000000000251523262174200324530ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/features/one.js000066400000000000000000000000251523262174200322610ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/features/three.js000066400000000000000000000000251523262174200326070ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/features/two.js000066400000000000000000000000251523262174200323110ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/index.js000066400000000000000000000000251523262174200307710ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/fixture/src/utils.js000066400000000000000000000000251523262174200310220ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/self-reference/index.bench.mjs000066400000000000000000000026371523262174200277620ustar00rootroot00000000000000/* * self-reference * * Exercises the SelfReferencePlugin: a package can import itself by its * own package name, which must match the `name` in its own package.json * and go through the exports field. This lives on the `raw-module` hook * and adds work to every bare specifier attempt. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], conditionNames: ["node", "require"], }); const from = path.join(fixtureDir, "src"); const requests = [ "self-ref-pkg", "self-ref-pkg/utils", "self-ref-pkg/features/one", "self-ref-pkg/features/two", "self-ref-pkg/features/three", "self-ref-pkg/features/four", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("self-reference: import own package name (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/stack-churn/000077500000000000000000000000001523262174200244075ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/stack-churn/fixture/000077500000000000000000000000001523262174200260755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/stack-churn/fixture/package.json000066400000000000000000000000721523262174200303620ustar00rootroot00000000000000{ "name": "stack-churn-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/stack-churn/fixture/target.js000066400000000000000000000000331523262174200277150ustar00rootroot00000000000000module.exports = "target"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/stack-churn/index.bench.mjs000066400000000000000000000054311523262174200273120ustar00rootroot00000000000000/* * stack-churn * * Measures the allocation pressure of `doResolve`'s recursion-tracking * stack across many moderately-deep alias rewrites. * * Every level of alias rewriting re-enters the resolver pipeline via * `doResolve`, which has to extend the stack used to detect cycles. * On the `Set`-clone baseline this means `new Set(parent)` per * level — a fresh hash-table allocation and an O(n) copy on every hook * re-entry. Under a long-running async workload the resulting GC churn * is what actually shows up in the numbers (look at p99 / rme when * running this case: the Set-clone baseline has markedly higher * variance from GC pauses). * * Unlike `pathological-deep-stack` (one very long chain), this case * fans out across several independent chains so the stacks don't all * share a common long prefix — closer in shape to large real-world * alias configs where the resolver sees many unrelated but non-trivial * stacks. */ import fs from "fs"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; const CHAIN_COUNT = 4; const CHAIN_DEPTH = 60; const RESOLVES_PER_ITER = 20; /* * Build CHAIN_COUNT independent alias chains, each of length CHAIN_DEPTH: * c0-0 -> c0-1 -> ... -> c0-(n-1) -> ./target * c1-0 -> c1-1 -> ... -> c1-(n-1) -> ./target * ... * so every top-level resolve forces CHAIN_DEPTH `doResolve` re-entries. */ /** * @returns {{ name: string, alias: string }[]} alias list */ function buildChains() { const aliases = []; for (let chain = 0; chain < CHAIN_COUNT; chain++) { for (let i = 0; i < CHAIN_DEPTH - 1; i++) { aliases.push({ name: `c${chain}-${i}`, alias: `c${chain}-${i + 1}` }); } aliases.push({ name: `c${chain}-${CHAIN_DEPTH - 1}`, alias: "./target" }); } return aliases; } /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const aliases = buildChains(); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], alias: aliases, }); // Fixed request list (no randomness — CodSpeed requires deterministic work). const requests = []; for (let i = 0; i < RESOLVES_PER_ITER; i++) { requests.push(`c${i % CHAIN_COUNT}-0`); } const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, fixtureDir, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( `stack-churn: ${CHAIN_COUNT}x${CHAIN_DEPTH} alias chains, ${RESOLVES_PER_ITER} resolves`, async () => { for (const req of requests) { await resolve(req); } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/000077500000000000000000000000001523262174200240365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/000077500000000000000000000000001523262174200255245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/.gitignore000066400000000000000000000000101523262174200275030ustar00rootroot00000000000000linked/ webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/package.json000066400000000000000000000000561523262174200300130ustar00rootroot00000000000000{"name":"symlinks-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/real/000077500000000000000000000000001523262174200264475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/real/five.js000066400000000000000000000000251523262174200277330ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/real/four.js000066400000000000000000000000251523262174200277550ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/real/one.js000066400000000000000000000000251523262174200275630ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/real/three.js000066400000000000000000000000251523262174200301110ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/fixture/real/two.js000066400000000000000000000000251523262174200276130ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/symlinks/index.bench.mjs000066400000000000000000000051731523262174200267440ustar00rootroot00000000000000/* * symlinks * * Exercises SymlinkPlugin: every successful resolve hits this plugin on the * `existing-file` hook. With `symlinks: true` (the default) the plugin * follows each symlink to its real path via the fs cache, so resolving a * symlinked file does real I/O even after the target already exists. * * Symlinks are created on disk at registration time (not committed to * git) so the case is portable across platforms that support symlinks. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const linkedDir = path.join(fixtureDir, "linked"); // Create one symlink per real file. Links are relative (`../real/.js`) // so they'd be portable if ever committed — but we intentionally build // them at registration time and leave them out of git via .gitignore, // so the fixture stays OS-agnostic on checkout. fs.mkdirSync(linkedDir, { recursive: true }); const names = ["one", "two", "three", "four", "five"]; for (const name of names) { const linkPath = path.join(linkedDir, `${name}.js`); try { fs.unlinkSync(linkPath); } catch { // didn't exist } // Relative target so the link resolves regardless of where the repo // lives on disk. fs.symlinkSync(`../real/${name}.js`, linkPath); } const fileSystem = new CachedInputFileSystem(fs, 4000); const symlinkResolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], symlinks: true, }); const noSymlinkResolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], symlinks: false, }); const requests = names.map((n) => `./linked/${n}`); // Warm resolves allocate only a few KB, below CodSpeed's memory-mode noise // floor; repeat the batch so measured allocation clears it. const REPEAT = 20; const resolveWith = (resolver, req) => new Promise((resolve, reject) => { resolver.resolve({}, fixtureDir, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("symlinks: follow symlinks=true (warm)", async () => { for (let r = 0; r < REPEAT; r++) { for (const req of requests) { await resolveWith(symlinkResolver, req); } } }); bench.add("symlinks: symlinks=false (warm)", async () => { for (let r = 0; r < REPEAT; r++) { for (const req of requests) { await resolveWith(noSymlinkResolver, req); } } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/000077500000000000000000000000001523262174200250005ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/000077500000000000000000000000001523262174200264665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/node_modules/000077500000000000000000000000001523262174200311435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/node_modules/lodash/000077500000000000000000000000001523262174200324155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/node_modules/lodash/index.js000066400000000000000000000000251523262174200340570ustar00rootroot00000000000000module.exports = {}; package.json000066400000000000000000000000701523262174200346210ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/node_modules/lodash{"name":"lodash","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/package.json000066400000000000000000000000631523262174200307530ustar00rootroot00000000000000{"name":"sync-resolver-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/000077500000000000000000000000001523262174200272555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/a/000077500000000000000000000000001523262174200274755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/a/one.js000066400000000000000000000000251523262174200306110ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/a/three.js000066400000000000000000000000251523262174200311370ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/a/two.js000066400000000000000000000000251523262174200306410ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/b/000077500000000000000000000000001523262174200274765ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/b/five.js000066400000000000000000000000251523262174200307620ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/b/four.js000066400000000000000000000000251523262174200310040ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/fixture/src/index.js000066400000000000000000000000251523262174200307170ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/sync-resolver/index.bench.mjs000066400000000000000000000021771523262174200277070ustar00rootroot00000000000000/* * sync-resolver * * Measures the `useSyncFileSystemCalls: true` path via `resolveSync`, which * webpack's loader resolver uses. This path bypasses the async plumbing in * the resolver and is a distinct hot code path worth tracking separately * from the async case. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], useSyncFileSystemCalls: true, }); const from = path.join(fixtureDir, "src"); const requests = [ "./a/one", "./a/two", "./a/three", "./b/four", "./b/five", "lodash", ]; bench.add("sync-resolver: resolveSync mixed batch (warm)", () => { for (const req of requests) { const result = resolver.resolveSync({}, from, req); if (!result) throw new Error(`no result for ${req}`); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/000077500000000000000000000000001523262174200254515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/000077500000000000000000000000001523262174200271375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/package.json000066400000000000000000000000661523262174200314270ustar00rootroot00000000000000{"name":"tsconfig-extends-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/000077500000000000000000000000001523262174200277265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/features/000077500000000000000000000000001523262174200315445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/features/alpha.js000066400000000000000000000000251523262174200331640ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/features/beta.js000066400000000000000000000000251523262174200330120ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/features/gamma.js000066400000000000000000000000251523262174200331610ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/index.js000066400000000000000000000000251523262174200313700ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/shared/000077500000000000000000000000001523262174200311745ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/shared/helper.js000066400000000000000000000000251523262174200330060ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/src/shared/logger.js000066400000000000000000000000251523262174200330060ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/tsconfig.base.json000066400000000000000000000002211523262174200325520ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@shared/*": ["src/shared/*"], "@common/*": ["src/shared/*"] } } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/tsconfig.json000066400000000000000000000003451523262174200316500ustar00rootroot00000000000000{ "extends": "./tsconfig.mid.json", "compilerOptions": { "paths": { "@shared/*": ["src/shared/*"], "@common/*": ["src/shared/*"], "@features/*": ["src/features/*"], "@app/*": ["src/*"] } } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/fixture/tsconfig.mid.json000066400000000000000000000003131523262174200324130ustar00rootroot00000000000000{ "extends": "./tsconfig.base.json", "compilerOptions": { "paths": { "@shared/*": ["src/shared/*"], "@common/*": ["src/shared/*"], "@features/*": ["src/features/*"] } } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-extends/index.bench.mjs000066400000000000000000000027301523262174200303530ustar00rootroot00000000000000/* * tsconfig-extends * * TsconfigPathsPlugin with a 3-level `extends` chain * (tsconfig.json -> tsconfig.mid.json -> tsconfig.base.json). The plugin * reads and merges each config lazily on first resolve; this case exists * to catch regressions in the extends-resolution path and to measure the * warm cost once the chain has been read in. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], tsconfig: path.join(fixtureDir, "tsconfig.json"), }); const from = path.join(fixtureDir, "src"); const requests = [ "@app/index", "@features/alpha", "@features/beta", "@features/gamma", "@shared/helper", "@shared/logger", "@common/helper", "@common/logger", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("tsconfig-extends: 3-level extends chain (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/000077500000000000000000000000001523262174200251165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/000077500000000000000000000000001523262174200266045ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/package.json000066400000000000000000000000751523262174200310740ustar00rootroot00000000000000{ "name": "tsconfig-paths-fixture", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/000077500000000000000000000000001523262174200273735ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/app/000077500000000000000000000000001523262174200301535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/app/one.js000066400000000000000000000000251523262174200312670ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/app/three.js000066400000000000000000000000251523262174200316150ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/app/two.js000066400000000000000000000000251523262174200313170ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/components/000077500000000000000000000000001523262174200315605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/components/one.js000066400000000000000000000000251523262174200326740ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/components/three.js000066400000000000000000000000251523262174200332220ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/components/two.js000066400000000000000000000000251523262174200327240ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/shared/000077500000000000000000000000001523262174200306415ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/shared/helper.js000066400000000000000000000000251523262174200324530ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/shared/index.js000066400000000000000000000000251523262174200323030ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/utils/000077500000000000000000000000001523262174200305335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/utils/one.js000066400000000000000000000000251523262174200316470ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/utils/three.js000066400000000000000000000000251523262174200321750ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/src/utils/two.js000066400000000000000000000000251523262174200316770ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/fixture/tsconfig.json000066400000000000000000000004041523262174200313110ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@app/*": ["src/app/*"], "@components/*": ["src/components/*"], "@utils/*": ["src/utils/*"], "@shared/*": ["src/shared/*"], "shared": ["src/shared/index.js"] } } } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/tsconfig-paths/index.bench.mjs000066400000000000000000000027031523262174200300200ustar00rootroot00000000000000/* * tsconfig-paths * * Exercises TsconfigPathsPlugin: paths mapping with multiple wildcard * prefixes (`@app/*`, `@components/*`, ...) and a plain-string fallback * (`shared`). The plugin walks the paths list and tries each prefix, so * a batch that hits different prefixes forces every branch. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], tsconfig: path.join(fixtureDir, "tsconfig.json"), }); const from = path.join(fixtureDir, "src"); const requests = [ "@app/one", "@app/two", "@app/three", "@components/one", "@components/two", "@components/three", "@utils/one", "@utils/two", "@utils/three", "@shared/helper", "shared", ]; const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("tsconfig-paths: 5 path prefixes (warm)", async () => { for (const req of requests) { await resolve(req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/000077500000000000000000000000001523262174200263725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/000077500000000000000000000000001523262174200300605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/package.json000066400000000000000000000001031523262174200323400ustar00rootroot00000000000000{ "name": "unsafe-cache-key-build-fixture", "version": "0.0.0" } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/000077500000000000000000000000001523262174200306475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/000077500000000000000000000000001523262174200310675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/eight.js000066400000000000000000000000341523262174200325220ustar00rootroot00000000000000module.exports = "a/eight"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/five.js000066400000000000000000000000331523262174200323520ustar00rootroot00000000000000module.exports = "a/five"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/four.js000066400000000000000000000000331523262174200323740ustar00rootroot00000000000000module.exports = "a/four"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/nine.js000066400000000000000000000000331523262174200323520ustar00rootroot00000000000000module.exports = "a/nine"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/one.js000066400000000000000000000000321523262174200322010ustar00rootroot00000000000000module.exports = "a/one"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/seven.js000066400000000000000000000000341523262174200325420ustar00rootroot00000000000000module.exports = "a/seven"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/six.js000066400000000000000000000000321523262174200322230ustar00rootroot00000000000000module.exports = "a/six"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/ten.js000066400000000000000000000000321523262174200322060ustar00rootroot00000000000000module.exports = "a/ten"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/three.js000066400000000000000000000000341523262174200325310ustar00rootroot00000000000000module.exports = "a/three"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/a/two.js000066400000000000000000000000321523262174200322310ustar00rootroot00000000000000module.exports = "a/two"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/000077500000000000000000000000001523262174200310705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/eight.js000066400000000000000000000000341523262174200325230ustar00rootroot00000000000000module.exports = "b/eight"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/five.js000066400000000000000000000000331523262174200323530ustar00rootroot00000000000000module.exports = "b/five"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/four.js000066400000000000000000000000331523262174200323750ustar00rootroot00000000000000module.exports = "b/four"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/nine.js000066400000000000000000000000331523262174200323530ustar00rootroot00000000000000module.exports = "b/nine"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/one.js000066400000000000000000000000321523262174200322020ustar00rootroot00000000000000module.exports = "b/one"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/seven.js000066400000000000000000000000341523262174200325430ustar00rootroot00000000000000module.exports = "b/seven"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/six.js000066400000000000000000000000321523262174200322240ustar00rootroot00000000000000module.exports = "b/six"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/ten.js000066400000000000000000000000321523262174200322070ustar00rootroot00000000000000module.exports = "b/ten"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/three.js000066400000000000000000000000341523262174200325320ustar00rootroot00000000000000module.exports = "b/three"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/b/two.js000066400000000000000000000000321523262174200322320ustar00rootroot00000000000000module.exports = "b/two"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/000077500000000000000000000000001523262174200310715ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/eight.js000066400000000000000000000000341523262174200325240ustar00rootroot00000000000000module.exports = "c/eight"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/five.js000066400000000000000000000000331523262174200323540ustar00rootroot00000000000000module.exports = "c/five"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/four.js000066400000000000000000000000331523262174200323760ustar00rootroot00000000000000module.exports = "c/four"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/nine.js000066400000000000000000000000331523262174200323540ustar00rootroot00000000000000module.exports = "c/nine"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/one.js000066400000000000000000000000321523262174200322030ustar00rootroot00000000000000module.exports = "c/one"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/seven.js000066400000000000000000000000341523262174200325440ustar00rootroot00000000000000module.exports = "c/seven"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/six.js000066400000000000000000000000321523262174200322250ustar00rootroot00000000000000module.exports = "c/six"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/ten.js000066400000000000000000000000321523262174200322100ustar00rootroot00000000000000module.exports = "c/ten"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/three.js000066400000000000000000000000341523262174200325330ustar00rootroot00000000000000module.exports = "c/three"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/c/two.js000066400000000000000000000000321523262174200322330ustar00rootroot00000000000000module.exports = "c/two"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/000077500000000000000000000000001523262174200310725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/eight.js000066400000000000000000000000341523262174200325250ustar00rootroot00000000000000module.exports = "d/eight"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/five.js000066400000000000000000000000331523262174200323550ustar00rootroot00000000000000module.exports = "d/five"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/four.js000066400000000000000000000000331523262174200323770ustar00rootroot00000000000000module.exports = "d/four"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/nine.js000066400000000000000000000000331523262174200323550ustar00rootroot00000000000000module.exports = "d/nine"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/one.js000066400000000000000000000000321523262174200322040ustar00rootroot00000000000000module.exports = "d/one"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/seven.js000066400000000000000000000000341523262174200325450ustar00rootroot00000000000000module.exports = "d/seven"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/six.js000066400000000000000000000000321523262174200322260ustar00rootroot00000000000000module.exports = "d/six"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/ten.js000066400000000000000000000000321523262174200322110ustar00rootroot00000000000000module.exports = "d/ten"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/three.js000066400000000000000000000000341523262174200325340ustar00rootroot00000000000000module.exports = "d/three"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/fixture/src/d/two.js000066400000000000000000000000321523262174200322340ustar00rootroot00000000000000module.exports = "d/two"; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-key-build/index.bench.mjs000066400000000000000000000041621523262174200312750ustar00rootroot00000000000000/* * unsafe-cache-key-build * * Exercises the cache-id construction in `UnsafeCachePlugin` specifically. * Distinct from `unsafe-cache`, which measures the hot hit path on a small * request list: this one sweeps a wider set of requests so * `getCacheId()` gets called with varied (path, request, query, fragment) * tuples. The previous implementation serialized a temporary object via * `JSON.stringify`; the new one concatenates components directly with * NUL separators. A regression on either path shows up here. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); const from = path.join(fixtureDir, "src"); // 40 distinct requests so the cache-id hash table is populated and every // pass re-issues the same IDs (exercising the build-then-lookup path). const subDirs = ["a", "b", "c", "d"]; const names = [ "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", ]; const requests = []; for (const dir of subDirs) { for (const n of names) { requests.push(`./${dir}/${n}`); } } // Add some query/fragment variants so that branch of getCacheId is // covered too. for (const dir of subDirs) { requests.push(`./${dir}/one?v=1`); requests.push(`./${dir}/two#section`); } const resolve = (req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add( "unsafe-cache-key-build: 48 distinct requests, 3x pass, cached", async () => { for (let pass = 0; pass < 3; pass++) { for (const req of requests) { await resolve(req); } } }, ); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/000077500000000000000000000000001523262174200265725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/000077500000000000000000000000001523262174200302605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/node_modules/000077500000000000000000000000001523262174200327355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/node_modules/dep/000077500000000000000000000000001523262174200335055ustar00rootroot00000000000000index.js000066400000000000000000000000251523262174200350700ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/node_modules/depmodule.exports = {}; package.json000066400000000000000000000000651523262174200357150ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/node_modules/dep{"name":"dep","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/package.json000066400000000000000000000000751523262174200325500ustar00rootroot00000000000000{"name":"unsafe-cache-miss-heavy-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/000077500000000000000000000000001523262174200310475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/000077500000000000000000000000001523262174200312675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s1/000077500000000000000000000000001523262174200316125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s1/index.js000066400000000000000000000000251523262174200332540ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s10/000077500000000000000000000000001523262174200316725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s10/index.js000066400000000000000000000000251523262174200333340ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s2/000077500000000000000000000000001523262174200316135ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s2/index.js000066400000000000000000000000251523262174200332550ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s3/000077500000000000000000000000001523262174200316145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s3/index.js000066400000000000000000000000251523262174200332560ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s4/000077500000000000000000000000001523262174200316155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s4/index.js000066400000000000000000000000251523262174200332570ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s5/000077500000000000000000000000001523262174200316165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s5/index.js000066400000000000000000000000251523262174200332600ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s6/000077500000000000000000000000001523262174200316175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s6/index.js000066400000000000000000000000251523262174200332610ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s7/000077500000000000000000000000001523262174200316205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s7/index.js000066400000000000000000000000251523262174200332620ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s8/000077500000000000000000000000001523262174200316215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s8/index.js000066400000000000000000000000251523262174200332630ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s9/000077500000000000000000000000001523262174200316225ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/a/s9/index.js000066400000000000000000000000251523262174200332640ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/000077500000000000000000000000001523262174200312705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/000077500000000000000000000000001523262174200315125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/000077500000000000000000000000001523262174200317355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/000077500000000000000000000000001523262174200321615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/000077500000000000000000000000001523262174200324065ustar00rootroot00000000000000deep1/000077500000000000000000000000001523262174200333255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep1module.exports = {}; deep10/000077500000000000000000000000001523262174200334055ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200350470ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep10module.exports = {}; deep2/000077500000000000000000000000001523262174200333265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347700ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep2module.exports = {}; deep3/000077500000000000000000000000001523262174200333275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep3module.exports = {}; deep4/000077500000000000000000000000001523262174200333305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347720ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep4module.exports = {}; deep5/000077500000000000000000000000001523262174200333315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347730ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep5module.exports = {}; deep6/000077500000000000000000000000001523262174200333325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347740ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep6module.exports = {}; deep7/000077500000000000000000000000001523262174200333335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347750ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep7module.exports = {}; deep8/000077500000000000000000000000001523262174200333345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347760ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep8module.exports = {}; deep9/000077500000000000000000000000001523262174200333355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/findex.js000066400000000000000000000000251523262174200347770ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/fixture/src/b/c/d/e/f/deep9module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache-miss-heavy/index.bench.mjs000066400000000000000000000052341523262174200314760ustar00rootroot00000000000000/* * unsafe-cache-miss-heavy * * Stresses the `UnsafeCachePlugin` cache-key hot path: every request in the * batch has a unique (from, request) pair so the plugin must compute a * cache id for each one, and the first pass is a pure miss (so we measure * "build the key and insert" rather than "build the key and lookup"). * * We run two passes per bench iteration: * - pass 1: every request is a cache miss → worst case for `getCacheId` * - pass 2: every request is a cache hit → measures the hot lookup * path where the cache-id computation is the only non-trivial work * * Different from `unsafe-cache`, which only has 9 distinct requests and is * dominated by the "no work, just return the cached entry" path — here we * deliberately produce a cache with enough entries that `getCacheId` is the * observable cost. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 30 * 1000); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); // A mix of: // - relative paths from a shallow directory // - relative paths from a deeply nested directory (different from-path // means the requesting file's descriptionFilePath differs, but the // normalization in UnsafeCachePlugin collapses them) // - bare specifiers (different cache-key shape) // - query/fragment suffixed requests (exercise the query/fragment // fields in the cache id) const shallowFrom = path.join(fixtureDir, "src", "a"); const deepFrom = path.join(fixtureDir, "src", "b", "c", "d", "e", "f"); const requests = []; for (let i = 1; i <= 10; i++) { requests.push([shallowFrom, `./s${i}`]); requests.push([deepFrom, `./deep${i}`]); requests.push([shallowFrom, `./s${i}?v=1#top`]); requests.push([deepFrom, `./deep${i}?v=1#top`]); } requests.push([shallowFrom, "dep"]); requests.push([deepFrom, "dep"]); const resolve = (from, req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); bench.add("unsafe-cache-miss-heavy: 1 miss pass + 1 hit pass", async () => { for (const [from, req] of requests) { await resolve(from, req); } for (const [from, req] of requests) { await resolve(from, req); } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/000077500000000000000000000000001523262174200245075ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/000077500000000000000000000000001523262174200261755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/node_modules/000077500000000000000000000000001523262174200306525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/node_modules/dep/000077500000000000000000000000001523262174200314225ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/node_modules/dep/index.js000066400000000000000000000000251523262174200330640ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/node_modules/dep/package.json000066400000000000000000000000651523262174200337110ustar00rootroot00000000000000{"name":"dep","version":"1.0.0","main":"./index.js"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/package.json000066400000000000000000000000621523262174200304610ustar00rootroot00000000000000{"name":"unsafe-cache-fixture","version":"1.0.0"} webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/000077500000000000000000000000001523262174200267645ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/a/000077500000000000000000000000001523262174200272045ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/a/five.js000066400000000000000000000000251523262174200304700ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/a/four.js000066400000000000000000000000251523262174200305120ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/a/one.js000066400000000000000000000000251523262174200303200ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/a/three.js000066400000000000000000000000251523262174200306460ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/a/two.js000066400000000000000000000000251523262174200303500ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/b/000077500000000000000000000000001523262174200272055ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/b/eight.js000066400000000000000000000000251523262174200306400ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/b/seven.js000066400000000000000000000000251523262174200306600ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/fixture/src/b/six.js000066400000000000000000000000251523262174200303430ustar00rootroot00000000000000module.exports = {}; webpack-enhanced-resolve-7dfc9bc/benchmark/cases/unsafe-cache/index.bench.mjs000066400000000000000000000041201523262174200274040ustar00rootroot00000000000000/* * unsafe-cache * * Compares two resolvers: * - unsafe-cache ON: every request after the first hits UnsafeCachePlugin * and returns almost immediately * - unsafe-cache OFF: same request list pays full cost each time * * Repeats the request list several times per bench iteration so the * cache-hit path is dominant in the "on" case. */ import fs from "fs"; import path from "path"; import enhanced from "../../../lib/index.js"; const { ResolverFactory, CachedInputFileSystem } = enhanced; /** * @param {import("tinybench").Bench} bench bench * @param {{ fixtureDir: string }} ctx ctx */ export default function register(bench, { fixtureDir }) { const fileSystem = new CachedInputFileSystem(fs, 4000); const cachedResolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); const uncachedResolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: false, }); const from = path.join(fixtureDir, "src"); const requests = [ "./a/one", "./a/two", "./a/three", "./a/four", "./a/five", "./b/six", "./b/seven", "./b/eight", "dep", ]; const resolveWith = (resolver, req) => new Promise((resolve, reject) => { resolver.resolve({}, from, req, {}, (err, result) => { if (err) return reject(err); if (!result) return reject(new Error(`no result for ${req}`)); resolve(result); }); }); // Three passes per iteration so cache hits dominate the hot case. REPEAT // amplifies total allocation above CodSpeed's memory-mode noise floor // without changing the 3-pass cache-hit pattern. const REPEAT = 20; bench.add("unsafe-cache: ON, 3x repeat", async () => { for (let r = 0; r < REPEAT; r++) { for (let pass = 0; pass < 3; pass++) { for (const req of requests) { await resolveWith(cachedResolver, req); } } } }); bench.add("unsafe-cache: OFF, 3x repeat", async () => { for (let r = 0; r < REPEAT; r++) { for (let pass = 0; pass < 3; pass++) { for (const req of requests) { await resolveWith(uncachedResolver, req); } } } }); } webpack-enhanced-resolve-7dfc9bc/benchmark/run.mjs000066400000000000000000000074361523262174200224200ustar00rootroot00000000000000#!/usr/bin/env node /* * Benchmark entry point for enhanced-resolve. * * Discovers every directory under ./cases/ that contains an `index.bench.mjs` * file, calls its default-exported `register(bench, ctx)` function to * populate tinybench tasks, then runs them all. * * The bench is wrapped with a local `withCodSpeed()` bridge (ported from * webpack) so the same entry point works for: * - local development (`npm run benchmark`) -> wall-clock measurements * printed to the terminal; the wrapper detects that CodSpeed is not * active and returns the bench untouched * - CI under CodSpeedHQ/action -> the wrapper switches to instrumentation * mode automatically and results are uploaded to codspeed.io * * See ./README.md for the layout of individual cases. */ import fs from "fs/promises"; import path from "path"; import { fileURLToPath, pathToFileURL } from "url"; import { Bench, hrtimeNow } from "tinybench"; import { withCodSpeed } from "./with-codspeed.mjs"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const casesPath = path.join(__dirname, "cases"); /** * Filter expression from CLI or env (e.g. `npm run benchmark -- realistic`). * A case is included if its directory name contains this substring. Empty * means "include everything". */ const filter = process.env.BENCH_FILTER || process.argv[2] || ""; const bench = withCodSpeed( new Bench({ name: "enhanced-resolve", now: hrtimeNow, throws: true, warmup: true, warmupIterations: 2, // Kept deliberately low: each task's body already loops over many // resolve calls, and we want wall-clock runs to finish in a few // seconds. CodSpeed's simulation mode ignores this and instruments // exactly one iteration per task. iterations: 10, }), ); const caseDirs = (await fs.readdir(casesPath, { withFileTypes: true })) .filter((entry) => entry.isDirectory()) .map((entry) => entry.name) .filter((name) => !filter || name.includes(filter)) .sort(); if (caseDirs.length === 0) { console.error( filter ? `No benchmark cases matched filter "${filter}"` : "No benchmark cases found", ); process.exit(1); } for (const caseName of caseDirs) { const benchFile = path.join(casesPath, caseName, "index.bench.mjs"); try { await fs.access(benchFile); } catch { console.warn(`[skip] ${caseName}: no index.bench.mjs`); continue; } const mod = await import(pathToFileURL(benchFile).href); if (typeof mod.default !== "function") { throw new Error( `${caseName}/index.bench.mjs must export a default function`, ); } await mod.default(bench, { caseName, caseDir: path.join(casesPath, caseName), fixtureDir: path.join(casesPath, caseName, "fixture"), }); console.log(`Registered: ${caseName}`); } console.log(`\nRunning ${bench.tasks.length} tasks...\n`); await bench.run(); // Pretty-print results. Kept simple on purpose — CodSpeed uploads its own // data in CI; this table is for humans running locally. const rows = bench.tasks.map((task) => { const r = task.result; if (!r) return { name: task.name, status: "no result" }; // tinybench v6 result shape: latency/throughput objects, no top-level // hz / samples. `latency` fields are in ms already. const lat = r.latency; const tp = r.throughput; return { name: task.name, "ops/s": tp?.mean?.toFixed(2) ?? "n/a", "mean (ms)": lat?.mean?.toFixed(4) ?? "n/a", "p99 (ms)": lat?.p99?.toFixed(4) ?? "n/a", "rme (%)": lat?.rme?.toFixed(2) ?? "n/a", samples: lat?.samplesCount ?? 0, }; }); console.log(); console.table(rows); // Exit non-zero if any task threw, so CI picks it up. const failed = bench.tasks.filter((t) => t.result?.error); if (failed.length > 0) { console.error(`\n${failed.length} task(s) errored:`); for (const t of failed) { console.error(` - ${t.name}: ${t.result?.error?.message}`); } process.exit(1); } webpack-enhanced-resolve-7dfc9bc/benchmark/with-codspeed.mjs000066400000000000000000000126041523262174200243440ustar00rootroot00000000000000/* * CodSpeed <-> tinybench bridge for enhanced-resolve benchmarks. * * Ported from the equivalent wrapper in webpack's * test/BenchmarkTestCases.benchmark.mjs. The webpack version additionally * handles baseline comparison, MongoDB profiling, and git-root detection — * none of which apply here. * * Why not @codspeed/tinybench-plugin? * That package accesses tinybench Task internals (task.fn, task.fnOpts) * that were made private in tinybench v6, causing a TypeError in * simulation mode. webpack hit the same issue and uses @codspeed/core * directly — we follow their lead. * * Modes (via getCodspeedRunnerMode() from @codspeed/core): * "disabled" — returns the bench untouched (local runs) * "simulation" — overrides bench.run/runSync for CodSpeed instrumentation * (instruction-count measurement) * "memory" — same instrumentation code path as "simulation"; CodSpeed's * runner collects heap allocations via Massif instead of * instruction counts. InstrumentHooks.startBenchmark / * stopBenchmark are identical — the runner decides what to * sample between them. * "walltime" — left untouched; tinybench's built-in timing is used */ import path from "path"; import { fileURLToPath } from "url"; import { InstrumentHooks, getCodspeedRunnerMode, setupCore, teardownCore, } from "@codspeed/core"; /** @typedef {import("tinybench").Bench} Bench */ /** @typedef {import("tinybench").Task} Task */ /** @typedef {() => unknown | Promise} Fn */ const repoRoot = path.resolve( path.dirname(fileURLToPath(import.meta.url)), "..", ); /** * Capture the file that invoked bench.add() so we can build a stable URI * for CodSpeed to identify the benchmark. * @returns {string} calling file path relative to the repo root */ function getCallingFile() { const dummy = {}; const prev = Error.prepareStackTrace; const prevLimit = Error.stackTraceLimit; Error.stackTraceLimit = 10; Error.prepareStackTrace = (_err, trace) => trace; Error.captureStackTrace(dummy, getCallingFile); const trace = /** @type {NodeJS.CallSite[]} */ ( /** @type {{ stack: unknown }} */ (dummy).stack ); Error.prepareStackTrace = prev; Error.stackTraceLimit = prevLimit; let file = /** @type {string} */ (trace[1].getFileName() || ""); if (file.startsWith("file://")) file = fileURLToPath(file); if (!file) return ""; return path.relative(repoRoot, file); } // eslint-disable-next-line jsdoc/require-property /** @typedef {object} EXPECTED_OBJECT */ /** * @typedef {{ uri: string, fn: Fn, opts: EXPECTED_OBJECT | undefined }} TaskMeta * @type {WeakMap>} */ const metaMap = new WeakMap(); /** * @param {Bench} bench bench * @returns {Map} meta */ function getOrCreateMeta(bench) { let m = metaMap.get(bench); if (!m) { m = new Map(); metaMap.set(bench, m); } return m; } /** * Wrap a tinybench Bench so that CodSpeed simulation mode instruments each * task. In "disabled" and "walltime" modes the bench is returned as-is. * @param {Bench} bench bench * @returns {Bench} modified bench */ export function withCodSpeed(bench) { const mode = getCodspeedRunnerMode(); if (mode === "disabled" || mode === "walltime") return bench; // --- instrumented mode (simulation or memory) --- const meta = getOrCreateMeta(bench); const rawAdd = bench.add.bind(bench); bench.add = (name, fn, opts) => { const callingFile = getCallingFile(); const uri = `${callingFile}::${name}`; meta.set(name, { uri, fn, opts }); return rawAdd(name, fn, opts); }; const setup = () => { setupCore(); console.log(`[CodSpeed] running in ${mode} mode`); }; const teardown = () => { teardownCore(); console.log(`[CodSpeed] Done running ${bench.tasks.length} benches.`); return bench.tasks; }; /** * @param {Fn} fn fn * @param {boolean} isAsync true when is async, otherwise false * @returns {Fn} wrapped fn */ const wrapFrame = (fn, isAsync) => { if (isAsync) { // eslint-disable-next-line camelcase return async function __codspeed_root_frame__() { await fn(); }; } // eslint-disable-next-line camelcase return function __codspeed_root_frame__() { fn(); }; }; bench.run = async () => { setup(); for (const task of bench.tasks) { const m = /** @type {TaskMeta} */ (meta.get(task.name)); // Warm-up: run the body a few times to stabilise caches / JIT. for (let i = 0; i < bench.iterations - 1; i++) { await m.fn(); } // Instrumented run. global.gc?.(); InstrumentHooks.startBenchmark(); await wrapFrame(m.fn, true)(); InstrumentHooks.stopBenchmark(); InstrumentHooks.setExecutedBenchmark(process.pid, m.uri); console.log( `[CodSpeed] ${ InstrumentHooks.isInstrumented() ? "Measured" : "Checked" } ${m.uri}`, ); } return teardown(); }; bench.runSync = () => { setup(); for (const task of bench.tasks) { const m = /** @type {TaskMeta} */ (meta.get(task.name)); for (let i = 0; i < bench.iterations - 1; i++) { m.fn(); } global.gc?.(); InstrumentHooks.startBenchmark(); wrapFrame(m.fn, false)(); InstrumentHooks.stopBenchmark(); InstrumentHooks.setExecutedBenchmark(process.pid, m.uri); console.log( `[CodSpeed] ${ InstrumentHooks.isInstrumented() ? "Measured" : "Checked" } ${m.uri}`, ); } return teardown(); }; return bench; } webpack-enhanced-resolve-7dfc9bc/eslint.config.mjs000066400000000000000000000027461523262174200224230ustar00rootroot00000000000000import { defineConfig, globalIgnores } from "eslint/config"; import config from "eslint-config-webpack"; export default defineConfig([ globalIgnores(["benchmark/**/fixture/**"]), { extends: [config], }, { files: ["benchmark/**/*"], languageOptions: { parserOptions: { ecmaVersion: 2022, }, }, rules: { "no-console": "off", "import/namespace": "off", "n/hashbang": "off", "n/no-unsupported-features/es-syntax": "off", "n/no-unsupported-features/node-builtins": "off", "n/no-process-exit": "off", }, }, { // Cross-runtime smoke scripts run standalone on node/bun/deno and in a // browser sandbox; relax library-grade JSDoc rules, allow console // output (they're CLI scripts) and skip the `engines.node` version // checks (these files target newer runtimes by design). files: ["test/smoke/**/*"], rules: { "jsdoc/no-restricted-syntax": "off", "jsdoc/reject-any-type": "off", "unicorn/prefer-native-coercion-functions": "off", "n/no-unsupported-features/es-builtins": "off", "n/no-unsupported-features/es-syntax": "off", "n/no-unsupported-features/node-builtins": "off", "no-console": "off", }, }, { // The test suite relies on `node:test` and modern `node:assert` helpers, // which are newer than the `engines.node` range the published library // targets. Tests are dev-only, so the builtin version check does not apply. files: ["test/*.js"], rules: { "n/no-unsupported-features/node-builtins": "off", }, }, ]); webpack-enhanced-resolve-7dfc9bc/generate-types-config.js000066400000000000000000000001631523262174200236720ustar00rootroot00000000000000"use strict"; module.exports = { typeMapping: { "^signal in Abortable events Interface": "AbortSignal", }, }; webpack-enhanced-resolve-7dfc9bc/jest.config.js000066400000000000000000000011171523262174200217040ustar00rootroot00000000000000"use strict"; // TODO: drop this file together with `test/_runner.js`'s jest branch and the // legacy-only steps in the `test` CI job once `engines.node` is bumped to >= 18. // Jest config is only consumed by the legacy leg of the test matrix // (Node.js < 18) where `node:test` is not available. Modern runs use // `node --test` via scripts/test.js and ignore this file. module.exports = { roots: ["/test"], moduleFileExtensions: ["js", "mjs", "cjs", "ts"], modulePathIgnorePatterns: ["/test/fixtures/"], setupFiles: ["/test/polyfill-text-encoding.js"], }; webpack-enhanced-resolve-7dfc9bc/lib/000077500000000000000000000000001523262174200177035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/lib/AliasFieldPlugin.js000066400000000000000000000077321523262174200234260ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const DescriptionFileUtils = require("./DescriptionFileUtils"); const getInnerRequest = require("./getInnerRequest"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").JsonPrimitive} JsonPrimitive */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ // Sentinel stored in `_fieldDataCache` when a description file does not // contain a usable alias field object. Lets us distinguish "not cached yet" // from "no valid field" without calling back into `getField`. const NO_FIELD_OBJECT = Symbol("NoFieldObject"); module.exports = class AliasFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | string[]} field field * @param {string | ResolveStepHook} target target */ constructor(source, field, target) { this.source = source; this.field = field; this.target = target; // `this.field` is fixed for the plugin's lifetime, so caching // per description-file content is safe. The cached value is either // the resolved alias-map object or the `NO_FIELD_OBJECT` sentinel // meaning "description file has no usable alias field". /** @type {WeakMap} */ this._fieldDataCache = new WeakMap(); } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("AliasFieldPlugin", (request, resolveContext, callback) => { if (!request.descriptionFileData) return callback(); const innerRequest = getInnerRequest(resolver, request); if (!innerRequest) return callback(); const { descriptionFileData } = request; let fieldData = this._fieldDataCache.get(descriptionFileData); if (fieldData === undefined) { const raw = DescriptionFileUtils.getField( descriptionFileData, this.field, ); fieldData = raw === null || typeof raw !== "object" ? NO_FIELD_OBJECT : /** @type {{ [k: string]: JsonPrimitive }} */ (raw); this._fieldDataCache.set(descriptionFileData, fieldData); } if (fieldData === NO_FIELD_OBJECT) { if (resolveContext.log) { resolveContext.log( `Field '${this.field}' doesn't contain a valid alias configuration`, ); } return callback(); } /** @type {JsonPrimitive | undefined} */ const data = Object.prototype.hasOwnProperty.call( fieldData, innerRequest, ) ? /** @type {{ [Key in string]: JsonPrimitive }} */ (fieldData)[ innerRequest ] : innerRequest.startsWith("./") ? /** @type {{ [Key in string]: JsonPrimitive }} */ (fieldData)[ innerRequest.slice(2) ] : undefined; if (data === innerRequest) return callback(); if (data === undefined) return callback(); if (data === false) { /** @type {ResolveRequest} */ const ignoreObj = { ...request, path: false, }; if (typeof resolveContext.yield === "function") { resolveContext.yield(ignoreObj); return callback(null, null); } return callback(null, ignoreObj); } /** @type {ResolveRequest} */ const obj = { ...request, path: /** @type {string} */ (request.descriptionFileRoot), request: /** @type {string} */ (data), fullySpecified: false, }; resolver.doResolve( target, obj, `aliased from description file ${ request.descriptionFilePath } with mapping '${innerRequest}' to '${/** @type {string} */ data}'`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow other aliasing or raw request if (result === undefined) return callback(null, null); callback(null, result); }, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/AliasPlugin.js000066400000000000000000000040401523262174200224470ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {string | string[] | false} Alias */ /** @typedef {{ alias: Alias, name: string, onlyModule?: boolean }} AliasOption */ const { aliasResolveHandler, compileAliasOptions } = require("./AliasUtils"); /** * When `alias` is given as an array, the targets are tried in priority * order and the first matching one wins. Tried-and-failed higher-priority * targets are recorded on `resolveContext.missingDependencies` (via the * downstream `FileExistsPlugin`) so that a consumer's watcher can * invalidate the resolve once one of them appears. The winning target is * recorded on `resolveContext.fileDependencies`; its removal triggers * re-resolution, at which point the fallback target is returned. * * Callers that cache successful resolves (e.g. webpack's `unsafeCache`) * are responsible for invalidating those entries when the tracked * dependencies change -- otherwise a stale path may survive across * rebuilds even though this plugin itself would return the correct * fallback on a fresh resolve. */ module.exports = class AliasPlugin { /** * @param {string | ResolveStepHook} source source * @param {AliasOption | AliasOption[]} options options * @param {string | ResolveStepHook} target target */ constructor(source, options, target) { this.source = source; this.options = Array.isArray(options) ? options : [options]; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const compiled = compileAliasOptions(resolver, this.options); resolver .getHook(this.source) .tapAsync("AliasPlugin", (request, resolveContext, callback) => { aliasResolveHandler( resolver, compiled, target, request, resolveContext, callback, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/AliasUtils.js000066400000000000000000000310331523262174200223130ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const forEachBail = require("./forEachBail"); const { PathType, getType } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */ /** @typedef {string | string[] | false} Alias */ /** @typedef {{ alias: Alias, name: string, onlyModule?: boolean }} AliasOption */ /** * @typedef {object} CompiledAliasOption * @property {string} name original alias name * @property {string} nameWithSlash name + "/" — precomputed to avoid per-resolve concat * @property {Alias} alias alias target(s) * @property {boolean} onlyModule normalized onlyModule flag * @property {string | null} absolutePath absolute form of `name` (with slash ending), null when not absolute * @property {string | null} wildcardPrefix substring before the single "*" in `name`, null when no wildcard * @property {string | null} wildcardSuffix substring after the single "*" in `name`, null when no wildcard * @property {number} firstCharCode first character code of `name` — used as a cheap screen on the hot path. `-1` indicates "matches any first char" (empty wildcard prefix). * @property {boolean} arrayAlias true when `alias` is an array — precomputed so the hot path skips `Array.isArray` */ /** * Bucketed view of compiled options used by `aliasResolveHandler` to avoid * walking the full option list on every resolve. The `all` array preserves * the legacy linear order (declaration order) for the fallback path. The * `byFirstChar` map buckets options by the first char code of their `name` * — each bucket preserves declaration order among its members. The * `hasAnyFirstChar` flag is true when at least one option matches any * first char (`firstCharCode === -1`), in which case resolve-time scans * fall back to `all` to keep declaration-order semantics across buckets. * The `useBuckets` flag is true only when bucketing would actually help — * i.e. there are at least 2 distinct first chars AND no empty-prefix * wildcard. When false, the resolve hot path skips the `Map.get` and * iterates `all` directly with the per-option first-char-code screen * (matching the pre-bucketing behavior). This avoids paying for `Map.get` * on degenerate single-bucket lists like a long chain of aliases that * all share one first char — the bucket lookup adds overhead without * narrowing the candidate set, which showed up as a transient-memory * regression on `pathological-deep-stack`. * @typedef {object} CompiledAliasOptions * @property {CompiledAliasOption[]} all declaration-ordered list * @property {Map} byFirstChar bucketed by first char code * @property {boolean} hasAnyFirstChar true when an empty-prefix wildcard is present * @property {boolean} useBuckets true when the bucket fast-path should be used at resolve time */ const EMPTY_LIST = /** @type {CompiledAliasOption[]} */ ([]); const EMPTY_COMPILED_OPTIONS = /** @type {CompiledAliasOptions} */ ({ all: EMPTY_LIST, byFirstChar: new Map(), hasAnyFirstChar: false, useBuckets: false, }); /** * Precompute per-option strings used on every resolve so the hot path in * `aliasResolveHandler` does no string concatenation / split work per entry. * Called once per plugin apply — the returned structure is stable for the * lifetime of the resolver. * * Beyond the per-option precompute step, this also partitions the list into * a `byFirstChar` map so that, when no "empty-prefix" wildcards are * present, the resolve-time scan only walks options whose `name` starts * with the same char as the current request. For large alias lists (300+ * entries) this turns an O(N) screen into O(K) where K is the bucket size * for the request's first char. * @param {Resolver} resolver resolver * @param {AliasOption[]} options options * @returns {CompiledAliasOptions} compiled options */ function compileAliasOptions(resolver, options) { if (options.length === 0) return EMPTY_COMPILED_OPTIONS; const all = /** @type {CompiledAliasOption[]} */ ( Array.from({ length: options.length }) ); /** @type {Map} */ const byFirstChar = new Map(); let hasAnyFirstChar = false; for (let i = 0; i < options.length; i++) { const item = options[i]; const { name } = item; let absolutePath = null; const type = getType(name); if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) { absolutePath = resolver.join(name, "_").slice(0, -1); } const firstStar = name.indexOf("*"); let wildcardPrefix = null; let wildcardSuffix = null; if (firstStar !== -1 && !name.includes("*", firstStar + 1)) { wildcardPrefix = name.slice(0, firstStar); wildcardSuffix = name.slice(firstStar + 1); } // firstCharCode: used by `aliasResolveHandler` to quickly skip aliases // whose name can't possibly match the current innerRequest. For a plain // alias (no wildcard) the first char of the name is also the first char // of `nameWithSlash` and of `absolutePath` (since the latter is derived // from name via `resolver.join(name, "_")`, which only appends). For a // wildcard with a non-empty prefix, the first char of that prefix is // also the first char of name. Only the `name === "*"` case (empty // wildcard prefix) can match arbitrary first chars — encode that as -1. let firstCharCode; if (wildcardPrefix !== null && wildcardPrefix.length === 0) { firstCharCode = -1; } else { firstCharCode = name.length > 0 ? name.charCodeAt(0) : -1; } const compiled = { name, nameWithSlash: `${name}/`, alias: item.alias, onlyModule: Boolean(item.onlyModule), absolutePath, wildcardPrefix, wildcardSuffix, firstCharCode, arrayAlias: Array.isArray(item.alias), }; all[i] = compiled; if (firstCharCode === -1) { hasAnyFirstChar = true; } else { let bucket = byFirstChar.get(firstCharCode); if (bucket === undefined) { bucket = []; byFirstChar.set(firstCharCode, bucket); } bucket.push(compiled); } } // Only enable the bucket fast-path when it would actually help. With // a single bucket (all aliases share one first char, e.g. a chain of // `chain-0 -> chain-1 -> …` rewrites), the resolve-time `Map.get` // does no discrimination — every request lands in that one bucket // or in nothing — and the lookup is overhead compared to walking // `all` with the per-option first-char-code screen. Requiring 2+ // distinct first chars matches the cases where bucketing has // measurable benefit (huge-alias-* / large-alias-list / stack-churn). const useBuckets = !hasAnyFirstChar && byFirstChar.size >= 2; return { all, byFirstChar, hasAnyFirstChar, useBuckets }; } /** @typedef {(err?: null | Error, result?: null | ResolveRequest) => void} InnerCallback */ /** * @param {Resolver} resolver resolver * @param {CompiledAliasOptions} options compiled options * @param {ResolveStepHook} target target * @param {ResolveRequest} request request * @param {ResolveContext} resolveContext resolve context * @param {InnerCallback} callback callback * @returns {void} */ function aliasResolveHandler( resolver, options, target, request, resolveContext, callback, ) { if (options.all.length === 0) return callback(); const innerRequest = request.request || request.path; if (!innerRequest) return callback(); // Precompute values used in the inner scan loop so we don't recompute // them per option. This is meaningful when `options` has hundreds of // entries (e.g. monorepos with generated alias lists) — see the // `huge-alias-list` / `huge-alias-miss` benchmarks. const innerFirstCharCode = innerRequest.charCodeAt(0); const hasRequestString = Boolean(request.request); // Dispatch through the first-char-code bucket when it actually // narrows the candidate set (`useBuckets` requires 2+ distinct // first chars and no empty-prefix wildcard). When the field has // only one first-char bucket — e.g. a long chain of `chain-N` // aliases that all start with the same char — every request lands // in that one bucket or nothing, so `Map.get` is overhead vs. just // walking `all` with the per-option char-code screen. Walking // `all` also matches the pre-bucketing behavior and keeps the // `pathological-deep-stack` allocation profile flat. let scan; if (options.useBuckets) { const bucket = options.byFirstChar.get(innerFirstCharCode); if (bucket === undefined) return callback(); scan = bucket; } else { scan = options.all; } forEachBail( scan, (item, callback) => { // Char-code screen left in for the fallback (`options.all`) path // where the bucket dispatch above wasn't usable. In the bucket // path this is always true and folds into a no-op. const { firstCharCode } = item; if (firstCharCode !== -1 && firstCharCode !== innerFirstCharCode) { return callback(); } /** @type {boolean} */ let shouldStop = false; // For absolute-name aliases, accept the normalized // `absolutePath` form as well as the raw `nameWithSlash`. // `nameWithSlash` unconditionally appends `/`, so a raw // windows request with native backslashes // (e.g. `C:\\abs\\foo\\baz` against `name: "C:\\abs\\foo"`) // otherwise fails `startsWith("C:\\abs\\foo/")` and is // silently skipped. Mirroring the `absolutePath` check in // both branches closes the gap without changing any // existing matches. const { absolutePath } = item; const matchRequest = innerRequest === item.name || (!item.onlyModule && ((hasRequestString && innerRequest.startsWith(item.nameWithSlash)) || (absolutePath !== null && innerRequest.startsWith(absolutePath)))); const matchWildcard = !item.onlyModule && item.wildcardPrefix !== null; if (matchRequest || matchWildcard) { /** * @param {Alias} alias alias * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback * @returns {void} */ const resolveWithAlias = (alias, callback) => { if (alias === false) { /** @type {ResolveRequest} */ const ignoreObj = { ...request, path: false, }; if (typeof resolveContext.yield === "function") { resolveContext.yield(ignoreObj); return callback(null, null); } return callback(null, ignoreObj); } let newRequestStr; if ( matchWildcard && innerRequest.startsWith( /** @type {string} */ (item.wildcardPrefix), ) && innerRequest.endsWith(/** @type {string} */ (item.wildcardSuffix)) ) { const match = innerRequest.slice( /** @type {string} */ (item.wildcardPrefix).length, innerRequest.length - /** @type {string} */ (item.wildcardSuffix).length, ); newRequestStr = alias.toString().replace("*", match); } if ( matchRequest && innerRequest !== alias && !innerRequest.startsWith(`${alias}/`) ) { /** @type {string} */ const remainingRequest = innerRequest.slice(item.name.length); newRequestStr = alias + remainingRequest; } if (newRequestStr !== undefined) { shouldStop = true; /** @type {ResolveRequest} */ const obj = { ...request, request: newRequestStr, fullySpecified: false, }; return resolver.doResolve( target, obj, `aliased with mapping '${item.name}': '${alias}' to '${newRequestStr}'`, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); return callback(); }, ); } return callback(); }; /** * @param {(null | Error)=} err error * @param {(null | ResolveRequest)=} result result * @returns {void} */ const stoppingCallback = (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // Don't allow other aliasing or raw request if (shouldStop) return callback(null, null); return callback(); }; if (item.arrayAlias) { return forEachBail( /** @type {string[]} */ (item.alias), resolveWithAlias, stoppingCallback, ); } return resolveWithAlias(item.alias, stoppingCallback); } return callback(); }, callback, ); } module.exports.aliasResolveHandler = aliasResolveHandler; module.exports.compileAliasOptions = compileAliasOptions; webpack-enhanced-resolve-7dfc9bc/lib/AppendPlugin.js000066400000000000000000000022611523262174200226300ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class AppendPlugin { /** * @param {string | ResolveStepHook} source source * @param {string} appending appending * @param {string | ResolveStepHook} target target */ constructor(source, appending, target) { this.source = source; this.appending = appending; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("AppendPlugin", (request, resolveContext, callback) => { /** @type {ResolveRequest} */ const obj = { ...request, path: request.path + this.appending, relativePath: request.relativePath && request.relativePath + this.appending, }; resolver.doResolve( target, obj, this.appending, resolveContext, callback, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/CachedInputFileSystem.js000066400000000000000000000573401523262174200244460ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; // eslint-disable-next-line n/prefer-global/process const { nextTick } = require("process"); /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").PathLike} PathLike */ /** @typedef {import("./Resolver").PathOrFileDescriptor} PathOrFileDescriptor */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ /** @typedef {FileSystem & SyncFileSystem} BaseFileSystem */ /** * @template T * @typedef {import("./Resolver").FileSystemCallback} FileSystemCallback */ /** * @param {string} path path * @returns {string} dirname */ const dirname = (path) => { let idx = path.length - 1; while (idx >= 0) { const char = path.charCodeAt(idx); // slash or backslash if (char === 47 || char === 92) break; idx--; } if (idx < 0) return ""; return path.slice(0, idx); }; /** * @template T * @param {FileSystemCallback[]} callbacks callbacks * @param {Error | null} err error * @param {T} result result */ const runCallbacks = (callbacks, err, result) => { if (callbacks.length === 1) { callbacks[0](err, result); callbacks.length = 0; return; } let error; for (const callback of callbacks) { try { callback(err, result); } catch (err) { if (!error) error = err; } } callbacks.length = 0; if (error) throw error; }; // eslint-disable-next-line jsdoc/reject-function-type /** @typedef {Function} EXPECTED_FUNCTION */ // eslint-disable-next-line jsdoc/reject-any-type /** @typedef {any} EXPECTED_ANY */ /** * The first pending cache hit is held in these slots (a scheduled tick is * pending iff `firstCallback` is set); later hits from the same synchronous * burst spill into `dispatchQueue` as flat [callback, err, result] triples * and are drained by the same tick. This keeps the common single-hit case * as cheap as a plain `nextTick` while bursts share one tick. * @type {FileSystemCallback | undefined} */ let firstCallback; /** @type {Error | null} */ let firstErr = null; /** @type {EXPECTED_ANY} */ let firstResult; /** @type {EXPECTED_ANY[]} */ let dispatchQueue = []; let dispatchQueueLength = 0; /** @type {EXPECTED_ANY[]} */ let spareQueue = []; // upper bound on the spill-array capacity kept alive between bursts const MAX_RETAINED_QUEUE_LENGTH = 1024; const runDispatch = () => { const callback = /** @type {FileSystemCallback} */ ( firstCallback ); const err = firstErr; const result = firstResult; // clear before calling: hits made from inside a callback start a new tick firstCallback = undefined; firstErr = null; firstResult = undefined; if (dispatchQueueLength === 0) { // single hit: no queue bookkeeping, a throw affects nobody else callback(err, result); return; } const queue = dispatchQueue; const length = dispatchQueueLength; // ping-pong the two arrays so draining never allocates dispatchQueue = spareQueue; dispatchQueueLength = 0; let i = -3; try { callback(err, result); for (i = 0; i < length; i += 3) { queue[i](queue[i + 1], queue[i + 2]); } } finally { // a throwing callback must not starve the rest: re-schedule the // remainder ahead of anything scheduled during this drain (matching // the old per-tick FIFO order) and rethrow i += 3; if (i < length) { if (firstCallback === undefined) { // no reentrant hit took the slot, so `dispatchQueue` is empty firstCallback = queue[i]; firstErr = queue[i + 1]; firstResult = queue[i + 2]; nextTick(runDispatch); for (let j = i + 3; j < length; j++) { dispatchQueue[dispatchQueueLength++] = queue[j]; } } else { // a reentrant hit claimed the slot (and scheduled the tick); // displace it behind the remainder to keep FIFO order const rest = queue.slice(i, length); rest.push(firstCallback, firstErr, firstResult); for (let j = 0; j < dispatchQueueLength; j++) { rest.push(dispatchQueue[j]); } [firstCallback, firstErr, firstResult] = rest; dispatchQueue = rest.slice(3); dispatchQueueLength = dispatchQueue.length; } } // release references but keep the backing store, so the next burst // does not have to re-grow the array from scratch for (let j = 0; j < length; j++) queue[j] = undefined; // bound the permanently retained capacity after a rare giant burst if (queue.length > MAX_RETAINED_QUEUE_LENGTH) { queue.length = MAX_RETAINED_QUEUE_LENGTH; } spareQueue = queue; } }; /** * Cache hits stay asynchronous, but all hits from the same synchronous * execution share a single `nextTick` instead of scheduling one each. * @param {FileSystemCallback} callback callback * @param {Error | null} err error * @param {EXPECTED_ANY} result result */ const scheduleDispatch = (callback, err, result) => { if (firstCallback === undefined) { firstCallback = callback; firstErr = err; firstResult = result; nextTick(runDispatch); } else { const queue = dispatchQueue; queue[dispatchQueueLength] = callback; queue[dispatchQueueLength + 1] = err; queue[dispatchQueueLength + 2] = result; dispatchQueueLength += 3; } }; class OperationMergerBackend { /** * @param {EXPECTED_FUNCTION | undefined} provider async method in filesystem * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method in filesystem * @param {BaseFileSystem} providerContext call context for the provider methods */ constructor(provider, syncProvider, providerContext) { this._provider = provider; this._syncProvider = syncProvider; this._providerContext = providerContext; this._activeAsyncOperations = new Map(); this.provide = this._provider ? // Comment to align jsdoc /** * @param {PathLike | PathOrFileDescriptor} path path * @param {object | FileSystemCallback | undefined} options options * @param {FileSystemCallback=} callback callback * @returns {EXPECTED_ANY} result */ (path, options, callback) => { if (typeof options === "function") { callback = /** @type {FileSystemCallback} */ (options); options = undefined; } if ( typeof path !== "string" && !Buffer.isBuffer(path) && !(path instanceof URL) && typeof path !== "number" ) { /** @type {EXPECTED_FUNCTION} */ (callback)( new TypeError("path must be a string, Buffer, URL or number"), ); return; } if (options) { return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( this._providerContext, path, options, callback, ); } let callbacks = this._activeAsyncOperations.get(path); if (callbacks) { callbacks.push(callback); return; } this._activeAsyncOperations.set(path, (callbacks = [callback])); /** @type {EXPECTED_FUNCTION} */ (provider)( path, /** * @param {Error} err error * @param {EXPECTED_ANY} result result */ (err, result) => { this._activeAsyncOperations.delete(path); runCallbacks(callbacks, err, result); }, ); } : null; this.provideSync = this._syncProvider ? // Comment to align jsdoc /** * @param {PathLike | PathOrFileDescriptor} path path * @param {object=} options options * @returns {EXPECTED_ANY} result */ (path, options) => /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( this._providerContext, path, options, ) : null; } purge() {} purgeParent() {} } /* IDLE: insert data: goto SYNC SYNC: before provide: run ticks event loop tick: goto ASYNC_ACTIVE ASYNC: timeout: run tick, goto ASYNC_PASSIVE ASYNC_PASSIVE: before provide: run ticks IDLE --[insert data]--> SYNC --[event loop tick]--> ASYNC_ACTIVE --[interval tick]-> ASYNC_PASSIVE ^ | +---------[insert data]-------+ */ const STORAGE_MODE_IDLE = 0; const STORAGE_MODE_SYNC = 1; const STORAGE_MODE_ASYNC = 2; /** * @callback Provide * @param {PathLike | PathOrFileDescriptor} path path * @param {EXPECTED_ANY} options options * @param {FileSystemCallback} callback callback * @returns {void} */ class CacheBackend { /** * @param {number} duration max cache duration of items * @param {EXPECTED_FUNCTION | undefined} provider async method * @param {EXPECTED_FUNCTION | undefined} syncProvider sync method * @param {BaseFileSystem} providerContext call context for the provider methods */ constructor(duration, provider, syncProvider, providerContext) { this._duration = duration; this._provider = provider; this._syncProvider = syncProvider; this._providerContext = providerContext; /** @type {Map[]>} */ this._activeAsyncOperations = new Map(); /** @type {Map }>} */ this._data = new Map(); /** @type {Set[]} */ this._levels = []; for (let i = 0; i < 10; i++) this._levels.push(new Set()); if (duration !== Infinity) { for (let i = 5000; i < duration; i += 500) { this._levels.push(new Set()); } } this._currentLevel = 0; this._tickInterval = Math.floor(duration / this._levels.length); /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ this._mode = STORAGE_MODE_IDLE; /** @type {NodeJS.Timeout | undefined} */ this._timeout = undefined; /** @type {number | undefined} */ this._nextDecay = undefined; // eslint-disable-next-line no-warning-comments // @ts-ignore this.provide = provider ? this.provide.bind(this) : null; // eslint-disable-next-line no-warning-comments // @ts-ignore this.provideSync = syncProvider ? this.provideSync.bind(this) : null; } /** * @param {PathLike | PathOrFileDescriptor} path path * @param {EXPECTED_ANY} options options * @param {FileSystemCallback} callback callback * @returns {void} */ provide(path, options, callback) { if (typeof options === "function") { callback = options; options = undefined; } if ( typeof path !== "string" && !Buffer.isBuffer(path) && !(path instanceof URL) && typeof path !== "number" ) { callback(new TypeError("path must be a string, Buffer, URL or number")); return; } const strPath = typeof path !== "string" ? path.toString() : path; if (options) { return /** @type {EXPECTED_FUNCTION} */ (this._provider).call( this._providerContext, path, options, callback, ); } // When in sync mode we can move to async mode if (this._mode === STORAGE_MODE_SYNC) { this._enterAsyncMode(); } // Check in cache const cacheEntry = this._data.get(strPath); if (cacheEntry !== undefined) { if (cacheEntry.err) { return scheduleDispatch(callback, cacheEntry.err, undefined); } return scheduleDispatch(callback, null, cacheEntry.result); } // Check if there is already the same operation running let callbacks = this._activeAsyncOperations.get(strPath); if (callbacks !== undefined) { callbacks.push(callback); return; } this._activeAsyncOperations.set(strPath, (callbacks = [callback])); // Run the operation /** @type {EXPECTED_FUNCTION} */ (this._provider).call( this._providerContext, path, /** * @param {Error | null} err error * @param {EXPECTED_ANY=} result result */ (err, result) => { this._activeAsyncOperations.delete(strPath); this._storeResult(strPath, err, result); // Enter async mode if not yet done this._enterAsyncMode(); runCallbacks( /** @type {FileSystemCallback[]} */ (callbacks), err, result, ); }, ); } /** * @param {PathLike | PathOrFileDescriptor} path path * @param {EXPECTED_ANY} options options * @returns {EXPECTED_ANY} result */ provideSync(path, options) { if ( typeof path !== "string" && !Buffer.isBuffer(path) && !(path instanceof URL) && typeof path !== "number" ) { throw new TypeError("path must be a string"); } const strPath = typeof path !== "string" ? path.toString() : path; if (options) { return /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( this._providerContext, path, options, ); } // In sync mode we may have to decay some cache items if (this._mode === STORAGE_MODE_SYNC) { this._runDecays(); } // Check in cache const cacheEntry = this._data.get(strPath); if (cacheEntry !== undefined) { if (cacheEntry.err) throw cacheEntry.err; return cacheEntry.result; } // Get all active async operations // This sync operation will also complete them const callbacks = this._activeAsyncOperations.get(strPath); this._activeAsyncOperations.delete(strPath); // Run the operation // When in idle mode, we will enter sync mode let result; try { result = /** @type {EXPECTED_FUNCTION} */ (this._syncProvider).call( this._providerContext, path, ); } catch (err) { this._storeResult(strPath, /** @type {Error} */ (err), undefined); this._enterSyncModeWhenIdle(); if (callbacks) { runCallbacks(callbacks, /** @type {Error} */ (err), undefined); } throw err; } this._storeResult(strPath, null, result); this._enterSyncModeWhenIdle(); if (callbacks) { runCallbacks(callbacks, null, result); } return result; } /** * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge * @param {{ exact?: boolean }=} options options; `exact: true` removes only entries whose key matches `what` exactly instead of any entry whose key starts with `what` */ purge(what, options) { if (what === undefined || what === null) { if (this._mode !== STORAGE_MODE_IDLE) { this._data.clear(); for (const level of this._levels) { level.clear(); } this._enterIdleMode(); } return; } const exact = options !== undefined && options !== null && options.exact === true; if (exact) { if ( typeof what === "string" || Buffer.isBuffer(what) || what instanceof URL || typeof what === "number" ) { const strWhat = typeof what !== "string" ? what.toString() : what; const data = this._data.get(strWhat); if (data !== undefined) { this._data.delete(strWhat); data.level.delete(strWhat); } } else { for (const item of what) { const strItem = typeof item !== "string" ? item.toString() : item; const data = this._data.get(strItem); if (data !== undefined) { this._data.delete(strItem); data.level.delete(strItem); } } } if (this._data.size === 0) { this._enterIdleMode(); } return; } if ( typeof what === "string" || Buffer.isBuffer(what) || what instanceof URL || typeof what === "number" ) { const strWhat = typeof what !== "string" ? what.toString() : what; if (strWhat === "") { // empty string is a prefix of every key — short-circuit the O(n) scan if (this._mode !== STORAGE_MODE_IDLE) { this._data.clear(); for (const level of this._levels) { level.clear(); } this._enterIdleMode(); } return; } for (const [key, data] of this._data) { if (key.startsWith(strWhat)) { this._data.delete(key); data.level.delete(key); } } if (this._data.size === 0) { this._enterIdleMode(); } } else { for (const [key, data] of this._data) { for (const item of what) { const strItem = typeof item !== "string" ? item.toString() : item; if (key.startsWith(strItem)) { this._data.delete(key); data.level.delete(key); break; } } } if (this._data.size === 0) { this._enterIdleMode(); } } } /** * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge */ purgeParent(what) { if (what === undefined || what === null) { this.purge(); } else if ( typeof what === "string" || Buffer.isBuffer(what) || what instanceof URL || typeof what === "number" ) { const strWhat = typeof what !== "string" ? what.toString() : what; this.purge(dirname(strWhat)); } else { const set = new Set(); for (const item of what) { const strItem = typeof item !== "string" ? item.toString() : item; set.add(dirname(strItem)); } this.purge(set); } } /** * @param {string} path path * @param {Error | null} err error * @param {EXPECTED_ANY} result result */ _storeResult(path, err, result) { if (this._data.has(path)) return; const level = this._levels[this._currentLevel]; this._data.set(path, { err, result, level }); level.add(path); } _decayLevel() { const nextLevel = (this._currentLevel + 1) % this._levels.length; const decay = this._levels[nextLevel]; this._currentLevel = nextLevel; for (const item of decay) { this._data.delete(item); } decay.clear(); if (this._data.size === 0) { this._enterIdleMode(); } else { /** @type {number} */ (this._nextDecay) += this._tickInterval; } } _runDecays() { while ( /** @type {number} */ (this._nextDecay) <= Date.now() && this._mode !== STORAGE_MODE_IDLE ) { this._decayLevel(); } } _enterAsyncMode() { let timeout = 0; switch (this._mode) { case STORAGE_MODE_ASYNC: return; case STORAGE_MODE_IDLE: this._nextDecay = Date.now() + this._tickInterval; timeout = this._tickInterval; break; case STORAGE_MODE_SYNC: this._runDecays(); // _runDecays may change the mode if ( /** @type {STORAGE_MODE_IDLE | STORAGE_MODE_SYNC | STORAGE_MODE_ASYNC} */ (this._mode) === STORAGE_MODE_IDLE ) { return; } timeout = Math.max( 0, /** @type {number} */ (this._nextDecay) - Date.now(), ); break; } this._mode = STORAGE_MODE_ASYNC; // When duration is Infinity, cache entries never expire, so there // is no need to schedule a decay timer. if (this._duration === Infinity) { return; } const ref = setTimeout(() => { this._mode = STORAGE_MODE_SYNC; this._runDecays(); }, timeout); if (ref.unref) ref.unref(); this._timeout = ref; } _enterSyncModeWhenIdle() { if (this._mode === STORAGE_MODE_IDLE) { this._mode = STORAGE_MODE_SYNC; this._nextDecay = Date.now() + this._tickInterval; } } _enterIdleMode() { this._mode = STORAGE_MODE_IDLE; this._nextDecay = undefined; if (this._timeout) clearTimeout(this._timeout); } } /** * @template {EXPECTED_FUNCTION} Provider * @template {EXPECTED_FUNCTION} AsyncProvider * @template FileSystem * @param {number} duration duration in ms files are cached * @param {Provider | undefined} provider provider * @param {AsyncProvider | undefined} syncProvider sync provider * @param {BaseFileSystem} providerContext provider context * @returns {OperationMergerBackend | CacheBackend} backend */ const createBackend = (duration, provider, syncProvider, providerContext) => { if (duration > 0) { return new CacheBackend(duration, provider, syncProvider, providerContext); } return new OperationMergerBackend(provider, syncProvider, providerContext); }; module.exports = class CachedInputFileSystem { /** * @param {BaseFileSystem} fileSystem file system * @param {number} duration duration in ms files are cached */ constructor(fileSystem, duration) { this.fileSystem = fileSystem; this._lstatBackend = createBackend( duration, this.fileSystem.lstat, this.fileSystem.lstatSync, this.fileSystem, ); const lstat = this._lstatBackend.provide; this.lstat = /** @type {FileSystem["lstat"]} */ (lstat); const lstatSync = this._lstatBackend.provideSync; this.lstatSync = /** @type {SyncFileSystem["lstatSync"]} */ (lstatSync); this._statBackend = createBackend( duration, this.fileSystem.stat, this.fileSystem.statSync, this.fileSystem, ); const stat = this._statBackend.provide; this.stat = /** @type {FileSystem["stat"]} */ (stat); const statSync = this._statBackend.provideSync; this.statSync = /** @type {SyncFileSystem["statSync"]} */ (statSync); this._readdirBackend = createBackend( duration, this.fileSystem.readdir, this.fileSystem.readdirSync, this.fileSystem, ); const readdir = this._readdirBackend.provide; this.readdir = /** @type {FileSystem["readdir"]} */ (readdir); const readdirSync = this._readdirBackend.provideSync; this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ ( readdirSync ); this._readFileBackend = createBackend( duration, this.fileSystem.readFile, this.fileSystem.readFileSync, this.fileSystem, ); const readFile = this._readFileBackend.provide; this.readFile = /** @type {FileSystem["readFile"]} */ (readFile); const readFileSync = this._readFileBackend.provideSync; this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ ( readFileSync ); this._readJsonBackend = createBackend( duration, // prettier-ignore this.fileSystem.readJson || (this.readFile && ( /** * @param {string} path path * @param {FileSystemCallback} callback callback */ (path, callback) => { this.readFile(path, (err, buffer) => { if (err) return callback(err); if (!buffer || buffer.length === 0) {return callback(new Error("No file content"));} let data; try { data = JSON.parse(buffer.toString("utf8")); } catch (err_) { return callback(/** @type {Error} */ (err_)); } callback(null, data); }); }) ), // prettier-ignore this.fileSystem.readJsonSync || (this.readFileSync && ( /** * @param {string} path path * @returns {EXPECTED_ANY} result */ (path) => { const buffer = this.readFileSync(path); const data = JSON.parse(buffer.toString("utf8")); return data; } )), this.fileSystem, ); const readJson = this._readJsonBackend.provide; this.readJson = /** @type {FileSystem["readJson"]} */ (readJson); const readJsonSync = this._readJsonBackend.provideSync; this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ ( readJsonSync ); this._readlinkBackend = createBackend( duration, this.fileSystem.readlink, this.fileSystem.readlinkSync, this.fileSystem, ); const readlink = this._readlinkBackend.provide; this.readlink = /** @type {FileSystem["readlink"]} */ (readlink); const readlinkSync = this._readlinkBackend.provideSync; this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ ( readlinkSync ); this._realpathBackend = createBackend( duration, this.fileSystem.realpath, this.fileSystem.realpathSync, this.fileSystem, ); const realpath = this._realpathBackend.provide; this.realpath = /** @type {FileSystem["realpath"]} */ (realpath); const realpathSync = this._realpathBackend.provideSync; this.realpathSync = /** @type {SyncFileSystem["realpathSync"]} */ ( realpathSync ); } /** * @param {(string | Buffer | URL | number | (string | URL | Buffer | number)[] | Set)=} what what to purge * @param {{ exact?: boolean }=} options options; `exact: true` removes only cache entries whose key matches `what` exactly instead of any entry whose key starts with `what` */ purge(what, options) { this._statBackend.purge(what, options); this._lstatBackend.purge(what, options); if (options !== undefined && options !== null && options.exact === true) { this._readdirBackend.purge(what, options); } else { this._readdirBackend.purgeParent(what); } this._readFileBackend.purge(what, options); this._readlinkBackend.purge(what, options); this._readJsonBackend.purge(what, options); this._realpathBackend.purge(what, options); } }; webpack-enhanced-resolve-7dfc9bc/lib/CloneBasenamePlugin.js000066400000000000000000000024401523262174200241140ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class CloneBasenamePlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("CloneBasenamePlugin", (request, resolveContext, callback) => { const requestPath = /** @type {string} */ (request.path); const filename = resolver.basename(requestPath); const filePath = resolver.join(requestPath, filename); /** @type {ResolveRequest} */ const obj = { ...request, path: filePath, relativePath: request.relativePath && resolver.join(request.relativePath, filename), }; resolver.doResolve( target, obj, `using path: ${filePath}`, resolveContext, callback, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/ConditionalPlugin.js000066400000000000000000000032731523262174200236700ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ConditionalPlugin { /** * @param {string | ResolveStepHook} source source * @param {Partial} test compare object * @param {string | null} message log message * @param {boolean} allowAlternatives when false, do not continue with the current step when "test" matches * @param {string | ResolveStepHook} target target */ constructor(source, test, message, allowAlternatives, target) { this.source = source; this.test = test; this.message = message; this.allowAlternatives = allowAlternatives; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const { test, message, allowAlternatives } = this; const keys = /** @type {(keyof ResolveRequest)[]} */ (Object.keys(test)); resolver .getHook(this.source) .tapAsync("ConditionalPlugin", (request, resolveContext, callback) => { for (const prop of keys) { if (request[prop] !== test[prop]) return callback(); } resolver.doResolve( target, request, message, resolveContext, allowAlternatives ? callback : (err, result) => { if (err) return callback(err); // Don't allow other alternatives if (result === undefined) return callback(null, null); callback(null, result); }, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/DescriptionFilePlugin.js000066400000000000000000000054011523262174200245030ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const DescriptionFileUtils = require("./DescriptionFileUtils"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const BACKSLASH_G = /\\/g; module.exports = class DescriptionFilePlugin { /** * @param {string | ResolveStepHook} source source * @param {string[]} filenames filenames * @param {boolean} pathIsFile pathIsFile * @param {string | ResolveStepHook} target target */ constructor(source, filenames, pathIsFile, target) { this.source = source; this.filenames = filenames; this.pathIsFile = pathIsFile; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "DescriptionFilePlugin", (request, resolveContext, callback) => { const { path } = request; if (!path) return callback(); const directory = this.pathIsFile ? DescriptionFileUtils.cdUp(path) : path; if (!directory) return callback(); DescriptionFileUtils.loadDescriptionFile( resolver, directory, this.filenames, request.descriptionFilePath ? { path: request.descriptionFilePath, content: request.descriptionFileData, directory: /** @type {string} */ (request.descriptionFileRoot), } : undefined, resolveContext, (err, result) => { if (err) return callback(err); if (!result) { if (resolveContext.log) { resolveContext.log( `No description file found in ${directory} or above`, ); } return callback(); } const rawRelative = path.slice(result.directory.length); const relativePath = `.${ rawRelative.includes("\\") ? rawRelative.replace(BACKSLASH_G, "/") : rawRelative }`; /** @type {ResolveRequest} */ const obj = { ...request, descriptionFilePath: result.path, descriptionFileData: result.content, descriptionFileRoot: result.directory, relativePath, }; resolver.doResolve( target, obj, `using description file: ${result.path} (relative path: ${relativePath})`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow other processing if (result === undefined) return callback(null, null); callback(null, result); }, ); }, ); }, ); } }; webpack-enhanced-resolve-7dfc9bc/lib/DescriptionFileUtils.js000066400000000000000000000155501523262174200243530ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const forEachBail = require("./forEachBail"); const { decodeText } = require("./util/fs"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").JsonObject} JsonObject */ /** @typedef {import("./Resolver").JsonValue} JsonValue */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** * @typedef {object} DescriptionFileInfo * @property {JsonObject=} content content * @property {string} path path * @property {string} directory directory */ /** * @callback ErrorFirstCallback * @param {Error | null=} error * @param {DescriptionFileInfo=} result */ /** * @typedef {object} Result * @property {string} path path to description file * @property {string} directory directory of description file * @property {JsonObject} content content of description file */ const CHAR_SLASH = 47; const CHAR_BACKSLASH = 92; /** * Walk up one directory. Called once per package-root candidate and once per * `described-resolve` (to find the enclosing description file), so it's on * the resolver's hot path. * * Previous implementation called `lastIndexOf("/")` and `lastIndexOf("\\")` * separately and then picked the larger. For any non-trivial directory * string on POSIX, `lastIndexOf("\\")` scans the full string just to return * -1. A single reverse char-code scan does the same work in one pass. * * Any single-character directory is treated as a root — `directory.length * <= 1` collapses the `"/"`, `"\\"` and `""` branches into one compare. * Without the `"\\"` case, `cdUp("\\")` (reached from a UNC root or a DOS * device path like `\\?\…`) would return itself via `slice(0, i || 1)` * and trap `loadDescriptionFile` in an infinite loop. Once single-char * roots are filtered up front, the reverse scan always produces a * strictly shorter string. * @param {string} directory directory * @returns {string | null} parent directory or null */ function cdUp(directory) { if (directory.length <= 1) return null; for (let i = directory.length - 1; i >= 0; i--) { const code = directory.charCodeAt(i); if (code === CHAR_SLASH || code === CHAR_BACKSLASH) { return directory.slice(0, i || 1); } } return null; } /** * @param {Resolver} resolver resolver * @param {string} directory directory * @param {string[]} filenames filenames * @param {DescriptionFileInfo | undefined} oldInfo oldInfo * @param {ResolveContext} resolveContext resolveContext * @param {ErrorFirstCallback} callback callback */ function loadDescriptionFile( resolver, directory, filenames, oldInfo, resolveContext, callback, ) { // Hoist the per-filename iterator and the per-level done callback out // of `findDescriptionFile`. They both close over `directory`, which we // reassign as we walk up the tree, so the same closures keep working // across every level — the previous implementation re-allocated both // arrows on every recursion step, which adds up on deep walks (multiple // `DescriptionFilePlugin` taps per resolve, each climbing several // directories looking for `package.json`). /** * @param {string} filename filename * @param {(err?: null | Error, result?: null | Result) => void} iterCallback callback * @returns {void} */ const iterFilename = (filename, iterCallback) => { const descriptionFilePath = resolver.join(directory, filename); /** * @param {(null | Error)=} err error * @param {JsonObject=} resolvedContent content * @returns {void} */ function onJson(err, resolvedContent) { if (err) { if (resolveContext.log) { resolveContext.log( `${descriptionFilePath} (directory description file): ${err}`, ); } else { err.message = `${descriptionFilePath} (directory description file): ${err}`; } return iterCallback(err); } iterCallback(null, { content: /** @type {JsonObject} */ (resolvedContent), directory, path: descriptionFilePath, }); } if (resolver.fileSystem.readJson) { resolver.fileSystem.readJson(descriptionFilePath, (err, content) => { if (err) { if ( typeof (/** @type {NodeJS.ErrnoException} */ (err).code) !== "undefined" ) { if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(descriptionFilePath); } return iterCallback(); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } return onJson(err); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } onJson(null, content); }); } else { resolver.fileSystem.readFile(descriptionFilePath, (err, content) => { if (err) { if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(descriptionFilePath); } return iterCallback(); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(descriptionFilePath); } /** @type {JsonObject | undefined} */ let json; if (content) { try { json = JSON.parse(decodeText(content)); } catch (/** @type {unknown} */ err_) { return onJson(/** @type {Error} */ (err_)); } } else { return onJson(new Error("No content in file")); } onJson(null, json); }); } }; // Forward-declared so the helpers below can reference each other // without falling foul of `no-use-before-define`. /** @type {() => void} */ let findDescriptionFile; /** * @param {(null | Error)=} err error * @param {(null | Result)=} result result * @returns {void} */ const onLevelDone = (err, result) => { if (err) return callback(err); if (result) return callback(null, result); const dir = cdUp(directory); if (!dir) { return callback(); } directory = dir; return findDescriptionFile(); }; findDescriptionFile = () => { if (oldInfo && oldInfo.directory === directory) { // We already have info for this directory and can reuse it return callback(null, oldInfo); } forEachBail(filenames, iterFilename, onLevelDone); }; findDescriptionFile(); } /** * @param {JsonObject} content content * @param {string | string[]} field field * @returns {JsonValue | undefined} field data */ function getField(content, field) { if (!content) return undefined; if (Array.isArray(field)) { /** @type {JsonValue} */ let current = content; for (let j = 0; j < field.length; j++) { if (current === null || typeof current !== "object") { current = null; break; } current = /** @type {JsonValue} */ ( /** @type {JsonObject} */ (current)[field[j]] ); } return current; } return content[field]; } module.exports.cdUp = cdUp; module.exports.getField = getField; module.exports.loadDescriptionFile = loadDescriptionFile; webpack-enhanced-resolve-7dfc9bc/lib/DirectoryExistsPlugin.js000066400000000000000000000035331523262174200245700ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class DirectoryExistsPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "DirectoryExistsPlugin", (request, resolveContext, callback) => { const fs = resolver.fileSystem; const directory = request.path; if (!directory) return callback(); fs.stat(directory, (err, stat) => { // Combine the two miss branches: a stat failure and a // "not a directory" result share the same handling — record // the path on `missingDependencies`, log the right reason, // then bail. The error-message ternary picks the wording // that matched the failing condition. if (err || !stat || !stat.isDirectory()) { if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(directory); } if (resolveContext.log) { resolveContext.log( err || !stat ? `${directory} doesn't exist` : `${directory} is not a directory`, ); } return callback(); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(directory); } resolver.doResolve( target, request, `existing directory ${directory}`, resolveContext, callback, ); }); }, ); } }; webpack-enhanced-resolve-7dfc9bc/lib/ExportsFieldPlugin.js000066400000000000000000000210001523262174200240210ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const DescriptionFileUtils = require("./DescriptionFileUtils"); const forEachBail = require("./forEachBail"); const { processExportsField } = require("./util/entrypoints"); const { parseIdentifier } = require("./util/identifier"); const { deprecatedInvalidSegmentRegEx, invalidSegmentRegEx, } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").JsonObject} JsonObject */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./util/entrypoints").ExportsField} ExportsField */ /** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ module.exports = class ExportsFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {Set} conditionNames condition names * @param {string | string[]} fieldNamePath name path * @param {string | ResolveStepHook} target target * @param {boolean=} restrictions whether `restrictions` are configured (enables exports-target fallback when a target is filtered out) */ constructor(source, conditionNames, fieldNamePath, target, restrictions) { this.source = source; this.target = target; this.conditionNames = conditionNames; this.fieldName = fieldNamePath; this.restrictions = Boolean(restrictions); // `null` is cached for description files that have no exports field, // so subsequent resolves against the same package.json skip the // `DescriptionFileUtils.getField` walk entirely. /** @type {WeakMap} */ this._fieldProcessorCache = new WeakMap(); } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("ExportsFieldPlugin", (request, resolveContext, callback) => { // When there is no description file, abort if (!request.descriptionFileData) return callback(); if ( // When the description file is inherited from parent, abort // (There is no description file inside of this package) request.relativePath !== "." || request.request === undefined ) { return callback(); } const { descriptionFileData } = request; const remainingRequest = request.query || request.fragment ? (request.request === "." ? "./" : request.request) + request.query + request.fragment : request.request; /** @type {string[]} */ let paths; /** @type {string | null} */ let usedField; try { // Look up the cached processor first. On a cache hit we // avoid re-walking the description file for the exports // field — and `null` is cached for description files that // have no exports field at all, so those skip the read // entirely. `processExportsField` can throw on a malformed // `exports` map (e.g. a key without a leading `.`), so // building the processor must stay inside this try/catch. let fieldProcessor = this._fieldProcessorCache.get(descriptionFileData); if ( fieldProcessor === undefined && !this._fieldProcessorCache.has(descriptionFileData) ) { const exportsField = /** @type {ExportsField | null | undefined} */ ( DescriptionFileUtils.getField( descriptionFileData, this.fieldName, ) ); fieldProcessor = exportsField ? processExportsField(exportsField) : null; this._fieldProcessorCache.set(descriptionFileData, fieldProcessor); } if (!fieldProcessor) return callback(); if (request.directory) { return callback( new Error( `Resolving to directories is not possible with the exports field (request was ${remainingRequest}/)`, ), ); } [paths, usedField] = fieldProcessor( remainingRequest, this.conditionNames, ); } catch (/** @type {unknown} */ err) { if (resolveContext.log) { resolveContext.log( `Exports field in ${request.descriptionFilePath} can't be processed: ${err}`, ); } return callback(/** @type {Error} */ (err)); } if (paths.length === 0) { const conditions = [...this.conditionNames]; const conditionsStr = conditions.length === 1 ? `the condition "${conditions[0]}"` : `the conditions ${JSON.stringify(conditions)}`; return callback( new Error( `"${remainingRequest}" is not exported under ${conditionsStr} from package ${request.descriptionFileRoot} (see exports field in ${request.descriptionFilePath})`, ), ); } // When `restrictions` are configured, share a marker down the // chain so RestrictionsPlugin can tell us it filtered out an // otherwise-valid target — then we fall back instead of erroring. const restrictionsMarker = this.restrictions ? { blocked: false } : undefined; forEachBail( paths, /** * @param {string} path path * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback * @param {number} i index * @returns {void} */ (path, callback, i) => { const parsedIdentifier = parseIdentifier(path); if (!parsedIdentifier) return callback(); const [relativePath, query, fragment] = parsedIdentifier; if (!relativePath.startsWith("./")) { if (paths.length === i) { return callback( new Error( `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, ), ); } return callback(); } const withoutDotSlash = relativePath.slice(2); if ( invalidSegmentRegEx.test(withoutDotSlash) && deprecatedInvalidSegmentRegEx.test(withoutDotSlash) ) { if (paths.length === i) { return callback( new Error( `Invalid "exports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, ), ); } return callback(); } /** @type {ResolveRequest} */ const obj = { ...request, request: undefined, path: resolver.join( /** @type {string} */ (request.descriptionFileRoot), relativePath, ), relativePath, query, fragment, }; // Attach the marker only when restrictions are configured, so // resolves without restrictions keep their request shape and // never leak the property onto the result. if (restrictionsMarker) { obj.__restrictionsMarker = restrictionsMarker; } resolver.doResolve( target, obj, `using exports field: ${path}`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 if (result === undefined) return callback(null, null); callback(null, result); }, ); }, /** * @param {(null | Error)=} err error * @param {(null | ResolveRequest)=} result result * @returns {void} */ (err, result) => { if (err) return callback(err); // When an exports field match was found but the target file doesn't exist, // return an error to prevent fallback to parent node_modules directories. // Per the Node.js ESM spec, a matched exports entry that fails to resolve // is a hard error, not a signal to continue searching up the directory tree. // See: https://github.com/webpack/enhanced-resolve/issues/399 if (!result) { // Exception: the target existed but `restrictions` filtered it // out — return no result so the next `modules` entry is tried. if (restrictionsMarker && restrictionsMarker.blocked) { return callback(null, null); } return callback( new Error( `Package path ${remainingRequest} is exported from package ${request.descriptionFileRoot}, but no valid target file was found (see exports field in ${request.descriptionFilePath})`, ), ); } // Drop the internal marker before it reaches the result. if (restrictionsMarker) delete result.__restrictionsMarker; callback(null, result); }, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/ExtensionAliasPlugin.js000066400000000000000000000112321523262174200243450ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const forEachBail = require("./forEachBail"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {{ alias: string | string[], extension: string }} ExtensionAliasOption */ module.exports = class ExtensionAliasPlugin { /** * @param {string | ResolveStepHook} source source * @param {ExtensionAliasOption} options options * @param {string | ResolveStepHook} target target */ constructor(source, options, target) { this.source = source; this.options = options; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const { extension, alias } = this.options; resolver .getHook(this.source) .tapAsync("ExtensionAliasPlugin", (request, resolveContext, callback) => { // Two modes of operation: // - "request" mode: original request specifier still carries the // extension (e.g. user wrote `./foo.js`). We swap the extension // on `request.request` and re-resolve. // - "path" mode: the specifier has already been joined into an // absolute `request.path` (e.g. produced by the imports field). // We swap the extension on `request.path` and `request.relativePath`. const useRequest = request.request !== undefined; const source = useRequest ? /** @type {string} */ (request.request) : request.path; if (!source || !source.endsWith(extension)) return callback(); const isAliasString = typeof alias === "string"; // Hoist the base (everything before the old extension) out of the // per-alias `resolve` callback. For an array `alias`, the callback // runs once per candidate extension; the base does not change // between iterations, so there's no reason to recompute it. const sourceBase = source.slice(0, -extension.length); const relativePathBase = !useRequest && request.relativePath && request.relativePath.endsWith(extension) ? request.relativePath.slice(0, -extension.length) : null; /** * @param {string} alias extension alias * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback * @param {number=} index index * @returns {void} */ const resolve = (alias, callback, index) => { const newValue = `${sourceBase}${alias}`; const nextRequest = useRequest ? { ...request, request: newValue, fullySpecified: true, } : { ...request, path: newValue, relativePath: relativePathBase !== null ? `${relativePathBase}${alias}` : request.relativePath, fullySpecified: true, }; return resolver.doResolve( target, nextRequest, `aliased from extension alias with mapping '${extension}' to '${alias}'`, resolveContext, (err, result) => { // Throw error if we are on the last alias (for multiple aliases) and it failed, always throw if we are not an array or we have only one alias if (!isAliasString && index) { if (index !== this.options.alias.length) { if (resolveContext.log) { resolveContext.log( `Failed to alias from extension alias with mapping '${extension}' to '${alias}' for '${newValue}': ${err}`, ); } return callback(null, result); } return callback(err, result); } callback(err, result); }, ); }; /** * @param {(null | Error)=} err error * @param {(null | ResolveRequest)=} result result * @returns {void} */ const stoppingCallback = (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // Listing the source extension among its own aliases keeps the // original request valid, so it must still be resolvable in its // normal (not fully specified) form: as a directory, or with // extensions appended. Only a mapping that drops the source // extension is strict. if (isAliasString ? alias === extension : alias.includes(extension)) { return callback(); } // Don't allow other aliasing or raw request return callback(null, null); }; if (isAliasString) { resolve(alias, stoppingCallback); } else if (alias.length > 1) { forEachBail(alias, resolve, stoppingCallback); } else { resolve(alias[0], stoppingCallback); } }); } }; webpack-enhanced-resolve-7dfc9bc/lib/FileExistsPlugin.js000066400000000000000000000033441523262174200235030ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class FileExistsPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const fs = resolver.fileSystem; resolver .getHook(this.source) .tapAsync("FileExistsPlugin", (request, resolveContext, callback) => { const file = request.path; if (!file) return callback(); fs.stat(file, (err, stat) => { // Combine the two miss branches: a stat failure and a // "not a file" result share the same handling — record the // path on `missingDependencies`, log the right reason, then // bail. The error-message ternary picks the wording that // matched the failing condition. if (err || !stat || !stat.isFile()) { if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(file); } if (resolveContext.log) { resolveContext.log( err || !stat ? `${file} doesn't exist` : `${file} is not a file`, ); } return callback(); } if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(file); } resolver.doResolve( target, request, `existing file: ${file}`, resolveContext, callback, ); }); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/ImportsFieldPlugin.js000066400000000000000000000160171523262174200240260ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const DescriptionFileUtils = require("./DescriptionFileUtils"); const forEachBail = require("./forEachBail"); const { processImportsField } = require("./util/entrypoints"); const { parseIdentifier } = require("./util/identifier"); const { invalidSegmentRegEx } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").JsonObject} JsonObject */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./util/entrypoints").FieldProcessor} FieldProcessor */ /** @typedef {import("./util/entrypoints").ImportsField} ImportsField */ const dotCode = ".".charCodeAt(0); module.exports = class ImportsFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {Set} conditionNames condition names * @param {string | string[]} fieldNamePath name path * @param {string | ResolveStepHook} targetFile target file * @param {string | ResolveStepHook} targetPackage target package */ constructor( source, conditionNames, fieldNamePath, targetFile, targetPackage, ) { this.source = source; this.targetFile = targetFile; this.targetPackage = targetPackage; this.conditionNames = conditionNames; this.fieldName = fieldNamePath; // `null` is cached for description files that have no imports field, // so subsequent resolves against the same package.json skip the // `DescriptionFileUtils.getField` walk entirely. /** @type {WeakMap} */ this._fieldProcessorCache = new WeakMap(); } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const targetFile = resolver.ensureHook(this.targetFile); const targetPackage = resolver.ensureHook(this.targetPackage); resolver .getHook(this.source) .tapAsync("ImportsFieldPlugin", (request, resolveContext, callback) => { // When there is no description file, abort if (!request.descriptionFileData || request.request === undefined) { return callback(); } const { descriptionFileData } = request; // Skip the concat when there's nothing to append — the common // case has empty query/fragment, so this avoids an allocation // per resolve. Mirrors the pattern in ExportsFieldPlugin. const remainingRequest = request.query || request.fragment ? request.request + request.query + request.fragment : request.request; /** @type {string[]} */ let paths; /** @type {string | null} */ let usedField; try { // Look up the cached processor first. On a cache hit we // avoid re-walking the description file for the imports // field — and `null` is cached for description files that // have no imports field at all, so those skip the read // entirely. `processImportsField` can throw on a // malformed `imports` map, so building the processor must // stay inside this try/catch. let fieldProcessor = this._fieldProcessorCache.get(descriptionFileData); if ( fieldProcessor === undefined && !this._fieldProcessorCache.has(descriptionFileData) ) { const importsField = /** @type {ImportsField | null | undefined} */ ( DescriptionFileUtils.getField( descriptionFileData, this.fieldName, ) ); fieldProcessor = importsField ? processImportsField(importsField) : null; this._fieldProcessorCache.set(descriptionFileData, fieldProcessor); } if (!fieldProcessor) return callback(); if (request.directory) { return callback( new Error( `Resolving to directories is not possible with the imports field (request was ${remainingRequest}/)`, ), ); } [paths, usedField] = fieldProcessor( remainingRequest, this.conditionNames, ); } catch (/** @type {unknown} */ err) { if (resolveContext.log) { resolveContext.log( `Imports field in ${request.descriptionFilePath} can't be processed: ${err}`, ); } return callback(/** @type {Error} */ (err)); } if (paths.length === 0) { return callback( new Error( `Package import ${remainingRequest} is not imported from package ${request.descriptionFileRoot} (see imports field in ${request.descriptionFilePath})`, ), ); } forEachBail( paths, /** * @param {string} path path * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback * @param {number} i index * @returns {void} */ (path, callback, i) => { const parsedIdentifier = parseIdentifier(path); if (!parsedIdentifier) return callback(); const [path_, query, fragment] = parsedIdentifier; switch (path_.charCodeAt(0)) { // should be relative case dotCode: { const withoutDotSlash = path_.slice(2); if (invalidSegmentRegEx.test(withoutDotSlash)) { if (paths.length === i) { return callback( new Error( `Invalid "imports" target "${path}" defined for "${usedField}" in the package config ${request.descriptionFilePath}, targets must start with "./"`, ), ); } return callback(); } /** @type {ResolveRequest} */ const obj = { ...request, request: undefined, path: resolver.join( /** @type {string} */ (request.descriptionFileRoot), path_, ), relativePath: path_, query, fragment, }; resolver.doResolve( targetFile, obj, `using imports field: ${path}`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 if (result === undefined) return callback(null, null); callback(null, result); }, ); break; } // package resolving default: { /** @type {ResolveRequest} */ const obj = { ...request, request: path_, relativePath: path_, fullySpecified: true, query, fragment, }; resolver.doResolve( targetPackage, obj, `using imports field: ${path}`, resolveContext, (err, result) => { if (err) return callback(err); // Don't allow to continue - https://github.com/webpack/enhanced-resolve/issues/400 if (result === undefined) return callback(null, null); callback(null, result); }, ); } } }, /** * @param {null | Error=} err error * @param {null | ResolveRequest=} result result * @returns {void} */ (err, result) => callback(err, result || null), ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/JoinRequestPartPlugin.js000066400000000000000000000036021523262174200245200ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const namespaceStartCharCode = "@".charCodeAt(0); module.exports = class JoinRequestPartPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "JoinRequestPartPlugin", (request, resolveContext, callback) => { const req = request.request || ""; let i = req.indexOf("/", 3); if (i >= 0 && req.charCodeAt(2) === namespaceStartCharCode) { i = req.indexOf("/", i + 1); } /** @type {string} */ let moduleName; /** @type {string} */ let remainingRequest; /** @type {boolean} */ let fullySpecified; if (i < 0) { moduleName = req; remainingRequest = "."; fullySpecified = false; } else { moduleName = req.slice(0, i); remainingRequest = `.${req.slice(i)}`; fullySpecified = /** @type {boolean} */ (request.fullySpecified); } /** @type {ResolveRequest} */ const obj = { ...request, path: resolver.join( /** @type {string} */ (request.path), moduleName, ), relativePath: request.relativePath && resolver.join(request.relativePath, moduleName), request: remainingRequest, fullySpecified, }; resolver.doResolve(target, obj, null, resolveContext, callback); }, ); } }; webpack-enhanced-resolve-7dfc9bc/lib/JoinRequestPlugin.js000066400000000000000000000023741523262174200236760ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class JoinRequestPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("JoinRequestPlugin", (request, resolveContext, callback) => { const requestPath = /** @type {string} */ (request.path); const requestRequest = /** @type {string} */ (request.request); /** @type {ResolveRequest} */ const obj = { ...request, path: resolver.join(requestPath, requestRequest), relativePath: request.relativePath && resolver.join(request.relativePath, requestRequest), request: undefined, }; resolver.doResolve(target, obj, null, resolveContext, callback); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/LogInfoPlugin.js000066400000000000000000000030421523262174200227540ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class LogInfoPlugin { /** * @param {string | ResolveStepHook} source source */ constructor(source) { this.source = source; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const { source } = this; resolver .getHook(this.source) .tapAsync("LogInfoPlugin", (request, resolveContext, callback) => { if (!resolveContext.log) return callback(); const { log } = resolveContext; const prefix = `[${source}] `; if (request.path) { log(`${prefix}Resolving in directory: ${request.path}`); } if (request.request) { log(`${prefix}Resolving request: ${request.request}`); } if (request.module) log(`${prefix}Request is an module request.`); if (request.directory) log(`${prefix}Request is a directory request.`); if (request.query) { log(`${prefix}Resolving request query: ${request.query}`); } if (request.fragment) { log(`${prefix}Resolving request fragment: ${request.fragment}`); } if (request.descriptionFilePath) { log( `${prefix}Has description data from ${request.descriptionFilePath}`, ); } if (request.relativePath) { log( `${prefix}Relative path from description file is: ${request.relativePath}`, ); } callback(); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/MainFieldPlugin.js000066400000000000000000000063521523262174200232560ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const DescriptionFileUtils = require("./DescriptionFileUtils"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").JsonObject} JsonObject */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {{ name: string | string[], forceRelative: boolean }} MainFieldOptions */ const alreadyTriedMainField = Symbol("alreadyTriedMainField"); // Sentinel cached for description files where the main field resolves to a // value we cannot use (missing, non-string, ".", "./"). Cheaper to store and // check than to re-walk the description file on every resolve. const NO_MAIN = Symbol("NoMain"); module.exports = class MainFieldPlugin { /** * @param {string | ResolveStepHook} source source * @param {MainFieldOptions} options options * @param {string | ResolveStepHook} target target */ constructor(source, options, target) { this.source = source; this.options = options; this.target = target; // Cache the resolved `mainModule` per description-file content. The // options (`name`, `forceRelative`) are fixed for this plugin // instance, so caching against content alone is safe. Stores either // the ready-to-use request string or the `NO_MAIN` sentinel. /** @type {WeakMap} */ this._mainModuleCache = new WeakMap(); } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("MainFieldPlugin", (request, resolveContext, callback) => { if ( request.path !== request.descriptionFileRoot || /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ (request)[alreadyTriedMainField] === request.descriptionFilePath || !request.descriptionFilePath ) { return callback(); } const descFileData = /** @type {JsonObject} */ ( request.descriptionFileData ); let mainModule = this._mainModuleCache.get(descFileData); if (mainModule === undefined) { let raw = /** @type {string | null | undefined} */ (DescriptionFileUtils.getField(descFileData, this.options.name)); if (!raw || typeof raw !== "string" || raw === "." || raw === "./") { this._mainModuleCache.set(descFileData, NO_MAIN); return callback(); } if (this.options.forceRelative && !/^\.\.?\//.test(raw)) { raw = `./${raw}`; } mainModule = raw; this._mainModuleCache.set(descFileData, mainModule); } else if (mainModule === NO_MAIN) { return callback(); } const filename = resolver.basename(request.descriptionFilePath); /** @type {ResolveRequest & { [alreadyTriedMainField]?: string }} */ const obj = { ...request, request: mainModule, module: false, directory: mainModule.endsWith("/"), [alreadyTriedMainField]: request.descriptionFilePath, }; return resolver.doResolve( target, obj, `use ${mainModule} from ${this.options.name} in ${filename}`, resolveContext, callback, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/ModulesInHierachicDirectoriesPlugin.js000066400000000000000000000003271523262174200273160ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; // TODO remove in next major module.exports = require("./ModulesInHierarchicalDirectoriesPlugin"); webpack-enhanced-resolve-7dfc9bc/lib/ModulesInHierarchicalDirectoriesPlugin.js000066400000000000000000000021611523262174200300130ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { modulesResolveHandler } = require("./ModulesUtils"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ModulesInHierarchicalDirectoriesPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | string[]} directories directories * @param {string | ResolveStepHook} target target */ constructor(source, directories, target) { this.source = source; this.directories = /** @type {string[]} */ [...directories]; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync( "ModulesInHierarchicalDirectoriesPlugin", (request, resolveContext, callback) => { modulesResolveHandler( resolver, this.directories, target, request, resolveContext, callback, ); }, ); } }; webpack-enhanced-resolve-7dfc9bc/lib/ModulesInRootPlugin.js000066400000000000000000000022131523262174200241610ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ModulesInRootPlugin { /** * @param {string | ResolveStepHook} source source * @param {string} path path * @param {string | ResolveStepHook} target target */ constructor(source, path, target) { this.source = source; this.path = path; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("ModulesInRootPlugin", (request, resolveContext, callback) => { /** @type {ResolveRequest} */ const obj = { ...request, path: this.path, request: `./${request.request}`, module: false, }; resolver.doResolve( target, obj, `looking for modules in ${this.path}`, resolveContext, callback, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/ModulesUtils.js000066400000000000000000000107401523262174200226740ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const forEachBail = require("./forEachBail"); const { getPathsCached } = require("./getPaths"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** @typedef {(err?: null | Error, result?: null | ResolveRequest) => void} InnerCallback */ /** * Per-(directories-array) cache of the flat `addrs` list produced for a given * `request.path`. For a fixed directories configuration the fan-out of * `ancestor × directory` is deterministic per request.path, and many resolves * share the same starting directory (sibling files in one project, loops over * a batch of imports, etc.) — caching avoids the `getPaths` regex split plus * `len(paths) × len(directories)` join calls per resolve. * * The outer map is keyed on the directories array reference (plugin-owned, * stable for the lifetime of the resolver), and the inner map on the * starting `request.path`. Kept private to this module (rather than hung off * `resolver.pathCache`) so the pathCache's hidden-class shape is unchanged — * that avoids perturbing the interpreter-mode IC state for the * `resolver.pathCache.{join,dirname,basename}.fn(...)` accesses that run on * every resolve, which the CodSpeed instruction-count harness is sensitive to. * @type {WeakMap>} */ const _addrsCacheByDirs = new WeakMap(); /** * @param {Resolver} resolver resolver * @param {string[]} directories directories * @param {ResolveStepHook} target target * @param {ResolveRequest} request request * @param {ResolveContext} resolveContext resolve context * @param {InnerCallback} callback callback * @returns {void} */ function modulesResolveHandler( resolver, directories, target, request, resolveContext, callback, ) { const fs = resolver.fileSystem; const requestPath = /** @type {string} */ (request.path); // Compute-or-reuse the flat `addrs` list. Inlined (rather than a helper // function) so the cache-hit path — which is the vast majority of // invocations — stays a single WeakMap + Map lookup with no function-call // overhead. See `_addrsCacheByDirs` above for caching rationale. let addrs; let perPath = _addrsCacheByDirs.get(directories); if (perPath === undefined) { perPath = new Map(); _addrsCacheByDirs.set(directories, perPath); } else { addrs = perPath.get(requestPath); } if (addrs === undefined) { const { paths } = getPathsCached(fs, requestPath); const pathsLen = paths.length; const dirsLen = directories.length; // Pre-size the flat array rather than going through `map().reduce()` // with intermediate arrays + spreads. // eslint-disable-next-line unicorn/no-new-array addrs = new Array(pathsLen * dirsLen); let idx = 0; const joinFn = resolver.pathCache.join.fn; for (let pi = 0; pi < pathsLen; pi++) { const pathItem = paths[pi]; for (let di = 0; di < dirsLen; di++) { addrs[idx++] = joinFn(pathItem, directories[di]); } } perPath.set(requestPath, addrs); } // Hoist the dot-prefixed request out of the per-addr iterator. `addrs` // can have up to `paths.length × directories.length` entries (e.g. 36 // for an 8-deep source dir × 4-module config), and concatenating the // same `./${request.request}` string on every iteration is wasted // work — it's constant for the whole fan-out. const relRequest = `./${request.request}`; forEachBail( addrs, /** * @param {string} addr addr * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback * @returns {void} */ (addr, callback) => { fs.stat(addr, (err, stat) => { if (!err && stat && stat.isDirectory()) { /** @type {ResolveRequest} */ const obj = { ...request, path: addr, request: relRequest, module: false, }; const message = `looking for modules in ${addr}`; return resolver.doResolve( target, obj, message, resolveContext, callback, ); } if (resolveContext.log) { resolveContext.log(`${addr} doesn't exist or is not a directory`); } if (resolveContext.missingDependencies) { resolveContext.missingDependencies.add(addr); } return callback(); }); }, callback, ); } module.exports = { modulesResolveHandler, }; webpack-enhanced-resolve-7dfc9bc/lib/NextPlugin.js000066400000000000000000000014431523262174200223400ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class NextPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("NextPlugin", (request, resolveContext, callback) => { resolver.doResolve(target, request, null, resolveContext, callback); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/ParsePlugin.js000066400000000000000000000052261523262174200224770ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ParsePlugin { /** * @param {string | ResolveStepHook} source source * @param {Partial} requestOptions request options * @param {string | ResolveStepHook} target target */ constructor(source, requestOptions, target) { this.source = source; this.requestOptions = requestOptions; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const { requestOptions } = this; resolver .getHook(this.source) .tapAsync("ParsePlugin", (request, resolveContext, callback) => { const parsed = resolver.parse(/** @type {string} */ (request.request)); /** @type {ResolveRequest} */ // Single spread + direct field assignment instead of // `{ ...request, ...parsed, ...requestOptions }` — avoids // two extra property enumerations on every resolve. // Keep in sync with Resolver.parse() output shape. const obj = { ...request }; obj.request = parsed.request; obj.query = parsed.query || request.query || ""; obj.fragment = parsed.fragment || request.fragment || ""; obj.module = parsed.module; obj.directory = parsed.directory; obj.file = parsed.file; obj.internal = parsed.internal; Object.assign(obj, requestOptions); if (parsed && resolveContext.log) { if (parsed.module) resolveContext.log("Parsed request is a module"); if (parsed.directory) { resolveContext.log("Parsed request is a directory"); } } // There is an edge-case where a request with # can be a path or a fragment -> try both if (obj.request && !obj.query && obj.fragment) { const directory = obj.fragment.endsWith("/"); /** @type {ResolveRequest} */ const alternative = { ...obj, directory, request: obj.request + (obj.directory ? "/" : "") + (directory ? obj.fragment.slice(0, -1) : obj.fragment), fragment: "", }; resolver.doResolve( target, alternative, null, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); resolver.doResolve(target, obj, null, resolveContext, callback); }, ); return; } resolver.doResolve(target, obj, null, resolveContext, callback); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/PnpPlugin.js000066400000000000000000000077211523262174200221640ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Maël Nison @arcanis */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** * @typedef {object} PnpApiImpl * @property {(packageName: string, issuer: string, options: { considerBuiltins: boolean }) => string | null} resolveToUnqualified resolve to unqualified */ module.exports = class PnpPlugin { /** * @param {string | ResolveStepHook} source source * @param {PnpApiImpl} pnpApi pnpApi * @param {string | ResolveStepHook} target target * @param {string | ResolveStepHook} alternateTarget alternateTarget */ constructor(source, pnpApi, target, alternateTarget) { this.source = source; this.pnpApi = pnpApi; this.target = target; this.alternateTarget = alternateTarget; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { /** @type {ResolveStepHook} */ const target = resolver.ensureHook(this.target); const alternateTarget = resolver.ensureHook(this.alternateTarget); resolver .getHook(this.source) .tapAsync("PnpPlugin", (request, resolveContext, callback) => { const req = request.request; if (!req) return callback(); // The trailing slash indicates to PnP that this value is a folder rather than a file const issuer = `${request.path}/`; const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req); if (!packageMatch) return callback(); const [packageName] = packageMatch; const innerRequest = `.${req.slice(packageName.length)}`; /** @type {string | undefined | null} */ let resolution; /** @type {string | undefined | null} */ let apiResolution; try { resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { considerBuiltins: false, }); if (resolution === null) { // This is either not a PnP managed issuer or it's a Node builtin // Try to continue resolving with our alternatives resolver.doResolve( alternateTarget, request, "issuer is not managed by a pnpapi", resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // Skip alternatives return callback(null, null); }, ); return; } if (resolveContext.fileDependencies) { apiResolution = this.pnpApi.resolveToUnqualified("pnpapi", issuer, { considerBuiltins: false, }); } } catch (/** @type {unknown} */ error) { if ( /** @type {Error & { code: string }} */ (error).code === "MODULE_NOT_FOUND" && /** @type {Error & { pnpCode: string }} */ (error).pnpCode === "UNDECLARED_DEPENDENCY" ) { // This is not a PnP managed dependency. // Try to continue resolving with our alternatives if (resolveContext.log) { resolveContext.log("request is not managed by the pnpapi"); for (const line of /** @type {Error} */ (error).message .split("\n") .filter(Boolean)) { resolveContext.log(` ${line}`); } } return callback(); } return callback(/** @type {Error} */ (error)); } if (resolution === packageName) return callback(); if (apiResolution && resolveContext.fileDependencies) { resolveContext.fileDependencies.add(apiResolution); } /** @type {ResolveRequest} */ const obj = { ...request, path: resolution, request: innerRequest, ignoreSymlinks: true, fullySpecified: request.fullySpecified && innerRequest !== ".", }; resolver.doResolve( target, obj, `resolved by pnp to ${resolution}`, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // Skip alternatives return callback(null, null); }, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/Resolver.js000066400000000000000000001301241523262174200220430ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } = require("tapable"); const createInnerContext = require("./createInnerContext"); const { parseIdentifier } = require("./util/identifier"); const { PathType, createCachedBasename, createCachedDirname, createCachedJoin, getType, normalize, toPath, } = require("./util/path"); /* eslint-disable jsdoc/check-alignment */ // TODO in the next major release use only `Promise.withResolvers()` const _withResolvers = // eslint-disable-next-line n/no-unsupported-features/es-syntax Promise.withResolvers ? /** * @param {Resolver} self resolver * @param {Context} context context information object * @param {string | URL} path context path or a `file:` URL instance * @param {string | URL} request request string or a `file:` URL instance * @param {ResolveContext} resolveContext resolve context * @returns {Promise} result */ (self, context, path, request, resolveContext) => { // eslint-disable-next-line n/no-unsupported-features/es-syntax const { promise, resolve, reject } = Promise.withResolvers(); self.resolve(context, path, request, resolveContext, (err, res) => { if (err) reject(err); else resolve(/** @type {string | false} */ (res)); }); return promise; } : /** * @param {Resolver} self resolver * @param {Context} context context information object * @param {string | URL} path context path or a `file:` URL instance * @param {string | URL} request request string or a `file:` URL instance * @param {ResolveContext} resolveContext resolve context * @returns {Promise} result */ (self, context, path, request, resolveContext) => new Promise((resolve, reject) => { self.resolve(context, path, request, resolveContext, (err, res) => { if (err) reject(err); else resolve(/** @type {string | false} */ (res)); }); }); /* eslint-enable jsdoc/check-alignment */ /** @typedef {import("./AliasUtils").AliasOption} AliasOption */ /** @typedef {import("./util/path").CachedJoin} CachedJoin */ /** @typedef {import("./util/path").CachedDirname} CachedDirname */ /** @typedef {import("./util/path").CachedBasename} CachedBasename */ /** * @typedef {object} JoinCacheEntry * @property {CachedJoin["fn"]} fn cached join function * @property {CachedJoin["cache"]} cache the underlying cache map */ /** * @typedef {object} DirnameCacheEntry * @property {CachedDirname["fn"]} fn cached dirname function * @property {CachedDirname["cache"]} cache the underlying cache map */ /** * @typedef {object} BasenameCacheEntry * @property {CachedBasename["fn"]} fn cached dirname function * @property {CachedBasename["cache"]} cache the underlying cache map */ /** * @typedef {object} PathCacheFunctions * @property {JoinCacheEntry} join cached join * @property {DirnameCacheEntry} dirname cached dirname * @property {BasenameCacheEntry} basename cached basename */ /** @type {WeakMap} */ const _pathCacheByFs = new WeakMap(); const HASH_ESCAPE_RE = /#/g; /** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */ /** * @typedef {object} KnownContext * @property {string[]=} environments environments */ // eslint-disable-next-line jsdoc/reject-any-type /** @typedef {KnownContext & Record} Context */ /** @typedef {Error & { details?: string }} ErrorWithDetail */ /** @typedef {(err: ErrorWithDetail | null, res?: string | false, req?: ResolveRequest) => void} ResolveCallback */ /** * @typedef {object} PossibleFileSystemError * @property {string=} code code * @property {number=} errno number * @property {string=} path path * @property {string=} syscall syscall */ /** * @template T * @callback FileSystemCallback * @param {PossibleFileSystemError & Error | null} err * @param {T=} result */ /** * @typedef {string | Buffer | URL} PathLike */ /** * @typedef {PathLike | number} PathOrFileDescriptor */ /** * @typedef {object} ObjectEncodingOptions * @property {BufferEncoding | null | undefined=} encoding encoding */ /** * @typedef {ObjectEncodingOptions | BufferEncoding | undefined | null} EncodingOption */ /** @typedef {(err: NodeJS.ErrnoException | null, result?: string) => void} StringCallback */ /** @typedef {(err: NodeJS.ErrnoException | null, result?: Buffer) => void} BufferCallback */ /** @typedef {(err: NodeJS.ErrnoException | null, result?: (string | Buffer)) => void} StringOrBufferCallback */ /** @typedef {(err: NodeJS.ErrnoException | null, result?: IStats) => void} StatsCallback */ /** @typedef {(err: NodeJS.ErrnoException | null, result?: IBigIntStats) => void} BigIntStatsCallback */ /** @typedef {(err: NodeJS.ErrnoException | null, result?: (IStats | IBigIntStats)) => void} StatsOrBigIntStatsCallback */ /** @typedef {(err: NodeJS.ErrnoException | Error | null, result?: JsonObject) => void} ReadJsonCallback */ /** * @template T * @typedef {object} IStatsBase * @property {() => boolean} isFile is file * @property {() => boolean} isDirectory is directory * @property {() => boolean} isBlockDevice is block device * @property {() => boolean} isCharacterDevice is character device * @property {() => boolean} isSymbolicLink is symbolic link * @property {() => boolean} isFIFO is FIFO * @property {() => boolean} isSocket is socket * @property {T} dev dev * @property {T} ino ino * @property {T} mode mode * @property {T} nlink nlink * @property {T} uid uid * @property {T} gid gid * @property {T} rdev rdev * @property {T} size size * @property {T} blksize blksize * @property {T} blocks blocks * @property {T} atimeMs atime ms * @property {T} mtimeMs mtime ms * @property {T} ctimeMs ctime ms * @property {T} birthtimeMs birthtime ms * @property {Date} atime atime * @property {Date} mtime mtime * @property {Date} ctime ctime * @property {Date} birthtime birthtime */ /** * @typedef {IStatsBase} IStats */ /** * @typedef {IStatsBase & { atimeNs: bigint, mtimeNs: bigint, ctimeNs: bigint, birthtimeNs: bigint }} IBigIntStats */ /** * @template {string | Buffer} [T=string] * @typedef {object} Dirent * @property {() => boolean} isFile true when is file, otherwise false * @property {() => boolean} isDirectory true when is directory, otherwise false * @property {() => boolean} isBlockDevice true when is block device, otherwise false * @property {() => boolean} isCharacterDevice true when is character device, otherwise false * @property {() => boolean} isSymbolicLink true when is symbolic link, otherwise false * @property {() => boolean} isFIFO true when is FIFO, otherwise false * @property {() => boolean} isSocket true when is socket, otherwise false * @property {T} name name * @property {string} parentPath path * @property {string=} path path */ /** * @typedef {object} StatOptions * @property {(boolean | undefined)=} bigint need bigint values */ /** * @typedef {object} StatSyncOptions * @property {(boolean | undefined)=} bigint need bigint values * @property {(boolean | undefined)=} throwIfNoEntry throw if no entry */ /** * @typedef {{ * (path: PathOrFileDescriptor, options: ({ encoding?: null | undefined, flag?: string | undefined } & import("events").Abortable) | undefined | null, callback: BufferCallback): void, * (path: PathOrFileDescriptor, options: ({ encoding: BufferEncoding, flag?: string | undefined } & import("events").Abortable) | BufferEncoding, callback: StringCallback): void, * (path: PathOrFileDescriptor, options: (ObjectEncodingOptions & { flag?: string | undefined } & import("events").Abortable) | BufferEncoding | undefined | null, callback: StringOrBufferCallback): void, * (path: PathOrFileDescriptor, callback: BufferCallback): void, * }} ReadFile */ /** * @typedef {"buffer" | { encoding: "buffer" }} BufferEncodingOption */ /** * @typedef {{ * (path: PathOrFileDescriptor, options?: { encoding?: null | undefined, flag?: string | undefined } | null): Buffer, * (path: PathOrFileDescriptor, options: { encoding: BufferEncoding, flag?: string | undefined } | BufferEncoding): string, * (path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & { flag?: string | undefined }) | BufferEncoding | null): string | Buffer, * }} ReadFileSync */ /** * @typedef {{ * (path: PathLike, options: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void, * (path: PathLike, options: { encoding: "buffer", withFileTypes?: false | undefined, recursive?: boolean | undefined } | "buffer", callback: (err: NodeJS.ErrnoException | null, files?: Buffer[]) => void): void, * (path: PathLike, options: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void): void, * (path: PathLike, callback: (err: NodeJS.ErrnoException | null, files?: string[]) => void): void, * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files?: Dirent[]) => void): void, * (path: PathLike, options: { encoding: "buffer", withFileTypes: true, recursive?: boolean | undefined }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void, * }} Readdir */ /** * @typedef {{ * (path: PathLike, options?: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | null): string[], * (path: PathLike, options: { encoding: "buffer", withFileTypes?: false | undefined, recursive?: boolean | undefined } | "buffer"): Buffer[], * (path: PathLike, options?: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | null): string[] | Buffer[], * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }): Dirent[], * (path: PathLike, options: { encoding: "buffer", withFileTypes: true, recursive?: boolean | undefined }): Dirent[], * }} ReaddirSync */ /** * @typedef {(pathOrFileDescription: PathOrFileDescriptor, callback: ReadJsonCallback) => void} ReadJson */ /** * @typedef {(pathOrFileDescription: PathOrFileDescriptor) => JsonObject} ReadJsonSync */ /** * @typedef {{ * (path: PathLike, options: EncodingOption, callback: StringCallback): void, * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void, * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void, * (path: PathLike, callback: StringCallback): void, * }} Readlink */ /** * @typedef {{ * (path: PathLike, options?: EncodingOption): string, * (path: PathLike, options: BufferEncodingOption): Buffer, * (path: PathLike, options?: EncodingOption): string | Buffer, * }} ReadlinkSync */ /** * @typedef {{ * (path: PathLike, callback: StatsCallback): void, * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void, * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void, * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void, * }} LStat */ /** * @typedef {{ * (path: PathLike, options?: undefined): IStats, * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined, * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined, * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats, * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats, * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats, * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined, * }} LStatSync */ /** * @typedef {{ * (path: PathLike, callback: StatsCallback): void, * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void, * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void, * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void, * }} Stat */ /** * @typedef {{ * (path: PathLike, options?: undefined): IStats, * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined, * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined, * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats, * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats, * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats, * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined, * }} StatSync */ /** * @typedef {{ * (path: PathLike, options: EncodingOption, callback: StringCallback): void, * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void, * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void, * (path: PathLike, callback: StringCallback): void, * }} RealPath */ /** * @typedef {{ * (path: PathLike, options?: EncodingOption): string, * (path: PathLike, options: BufferEncodingOption): Buffer, * (path: PathLike, options?: EncodingOption): string | Buffer, * }} RealPathSync */ /** * @typedef {object} FileSystem * @property {ReadFile} readFile read file method * @property {Readdir} readdir readdir method * @property {ReadJson=} readJson read json method * @property {Readlink} readlink read link method * @property {LStat=} lstat lstat method * @property {Stat} stat stat method * @property {RealPath=} realpath realpath method */ /** * @typedef {object} SyncFileSystem * @property {ReadFileSync} readFileSync read file sync method * @property {ReaddirSync} readdirSync read dir sync method * @property {ReadJsonSync=} readJsonSync read json sync method * @property {ReadlinkSync} readlinkSync read link sync method * @property {LStatSync=} lstatSync lstat sync method * @property {StatSync} statSync stat sync method * @property {RealPathSync=} realpathSync real path sync method */ /** * @typedef {object} ParsedIdentifier * @property {string} request request * @property {string} query query * @property {string} fragment fragment * @property {boolean} directory is directory * @property {boolean} module is module * @property {boolean} file is file * @property {boolean} internal is internal */ /** @typedef {string | number | boolean | null} JsonPrimitive */ /** @typedef {JsonValue[]} JsonArray */ /** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */ /** @typedef {{ [Key in string]?: JsonValue | undefined }} JsonObject */ /** * @typedef {object} TsconfigPathsMap * @property {TsconfigPathsData} main main tsconfig paths data * @property {string} mainContext main tsconfig base URL (absolute path) * @property {{ [baseUrl: string]: TsconfigPathsData }} refs referenced tsconfig paths data mapped by baseUrl * @property {{ [context: string]: TsconfigPathsData }} allContexts all contexts (main + refs) for quick lookup * @property {string[]} contextList precomputed `Object.keys(allContexts)` — read-only; used on the `_selectPathsDataForContext` hot path * @property {Set} fileDependencies file dependencies */ /** * @typedef {object} TsconfigPathsData * @property {import("./AliasUtils").CompiledAliasOptions} alias tsconfig file data * @property {string[]} modules tsconfig file data */ /** * @typedef {object} BaseResolveRequest * @property {string | false} path path * @property {Context=} context content * @property {string=} descriptionFilePath description file path * @property {string=} descriptionFileRoot description file root * @property {JsonObject=} descriptionFileData description file data * @property {TsconfigPathsMap | null | undefined=} tsconfigPathsMap tsconfig paths map * @property {string=} relativePath relative path * @property {boolean=} ignoreSymlinks true when need to ignore symlinks, otherwise false * @property {boolean=} fullySpecified true when full specified, otherwise false * @property {string=} __innerRequest inner request for internal usage * @property {string=} __innerRequest_request inner request for internal usage * @property {string=} __innerRequest_relativePath inner relative path for internal usage * @property {{ blocked: boolean }=} __restrictionsMarker internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring */ /** @typedef {BaseResolveRequest & Partial} ResolveRequest */ /** * @template T * @typedef {{ add: (item: T) => void }} WriteOnlySet */ /** @typedef {(request: ResolveRequest) => void} ResolveContextYield */ /** * Singly-linked stack entry that also exposes a Set-like API * (`has`, `size`, iteration). Each `doResolve` call prepends a new * `StackEntry` that points at the previous tip via `.parent`, so pushing * is O(1) in time and memory. Recursion detection walks the linked list * (O(n)) but the stack is typically shallow, so this is cheaper overall * than cloning a `Set` per call. */ class StackEntry { /** * @param {ResolveStepHook} hook hook * @param {ResolveRequest} request request * @param {StackEntry=} parent previous tip * @param {Set=} preSeeded entries pre-seeded via the legacy `Set` API */ constructor(hook, request, parent, preSeeded) { this.name = hook.name; this.path = request.path; this.request = request.request || ""; this.query = request.query || ""; this.fragment = request.fragment || ""; this.directory = Boolean(request.directory); this.module = Boolean(request.module); /** @type {StackEntry | undefined} */ this.parent = parent; /** * Strings seeded by callers that still pass `stack: new Set([...])`. * Propagated through the chain so deeper `doResolve` calls still see * them during recursion checks. `undefined` in the common case so * there is no extra work on the hot path. * @type {Set | undefined} */ this.preSeeded = preSeeded; } /** * Walk the linked list looking for an entry with the same request shape. * Set-compatible: callers that used `stack.has(entry)` keep working. * * NOTE: kept monomorphic on purpose. An earlier draft accepted a string * query too (so pre-5.21 plugins keeping their own `Set` of * seen entries could probe the live stack with the formatted form), * but adding the second shape regressed `doResolve`'s heap profile by * ~1 MiB / 200 resolves on stack-churn — V8 keeps a polymorphic * call-site state for `parent.has(stackEntry)` once `has` has two * argument shapes. Plugins that need string membership can reach for * `[...stack].find(e => e.includes(formattedString))` via the * `String`-method proxies on `StackEntry` instead. * @param {StackEntry} query entry to look for * @returns {boolean} whether the stack already contains an equivalent entry */ has(query) { /** @type {StackEntry | undefined} */ let node = this; while (node) { if ( node.name === query.name && node.path === query.path && node.request === query.request && node.query === query.query && node.fragment === query.fragment && node.directory === query.directory && node.module === query.module ) { return true; } node = node.parent; } return this.preSeeded !== undefined && this.preSeeded.has(query.toString()); } /** * Number of entries on the stack (oldest-to-newest length). * @returns {number} size */ get size() { let count = this.preSeeded ? this.preSeeded.size : 0; /** @type {StackEntry | undefined} */ let node = this; while (node) { count++; node = node.parent; } return count; } /** * Iterate entries from oldest (root) to newest (tip), matching how a * `Set` that was populated in insertion order would iterate. Pre-seeded * legacy `Set` entries come first so error-message output stays * ordered oldest-to-newest. * * Yields each entry as its formatted `toString()` form. Plugins written * against the pre-5.21 `Set` shape — e.g. * `[...resolveContext.stack].find(a => a.includes("module:"))` — keep * working unchanged because each yielded value is a plain string with * all of `String.prototype` available natively. Resolves that never * iterate the stack pay nothing; iteration costs one `toString()` * allocation per stack frame. * @returns {IterableIterator} iterator */ *[Symbol.iterator]() { if (this.preSeeded !== undefined) { for (const entry of this.preSeeded) yield entry; } /** @type {StackEntry[]} */ const entries = []; /** @type {StackEntry | undefined} */ let node = this; while (node) { entries.push(node); node = node.parent; } for (let i = entries.length - 1; i >= 0; i--) yield entries[i].toString(); } /** * Human-readable form used in recursion error messages, logs, and the * iterator above. Not memoized: caching would require an extra slot on * every `StackEntry`, which costs heap even on resolves that never look * at the formatted form. * @returns {string} formatted entry */ toString() { return `${this.name}: (${this.path}) ${this.request}${this.query}${ this.fragment }${this.directory ? " directory" : ""}${this.module ? " module" : ""}`; } } /** * Resolve context * @typedef {object} ResolveContext * @property {WriteOnlySet=} contextDependencies directories that was found on file system * @property {WriteOnlySet=} fileDependencies files that was found on file system * @property {WriteOnlySet=} missingDependencies dependencies that was not found on file system * @property {StackEntry | Set=} stack tip of the resolver call stack (a singly-linked list with Set-like API). For instance, `resolve → parsedResolve → describedResolve`. Accepts a legacy `Set` for back-compat with older callers; it is normalized internally without a hot-path branch. * @property {((str: string) => void)=} log log function * @property {ResolveContextYield=} yield yield result, if provided plugins can return several results */ /** @typedef {AsyncSeriesBailHook<[ResolveRequest, ResolveContext], ResolveRequest | null>} ResolveStepHook */ /** * @typedef {object} KnownHooks * @property {SyncHook<[ResolveStepHook, ResolveRequest], void>} resolveStep resolve step hook * @property {SyncHook<[ResolveRequest, Error]>} noResolve no resolve hook * @property {ResolveStepHook} resolve resolve hook * @property {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} result result hook */ /** * @typedef {{ [key: string]: ResolveStepHook }} EnsuredHooks */ /** * @param {string} str input string * @returns {string} in camel case */ function toCamelCase(str) { return str.replace(/-([a-z])/g, (str) => str.slice(1).toUpperCase()); } class Resolver { /** * @param {ResolveStepHook} hook hook * @param {ResolveRequest} request request * @param {StackEntry=} parent previous tip of the stack * @param {Set=} preSeeded entries pre-seeded via the legacy `Set` API * @returns {StackEntry} stack entry */ static createStackEntry(hook, request, parent, preSeeded) { return new StackEntry(hook, request, parent, preSeeded); } /** * @param {FileSystem} fileSystem a filesystem * @param {ResolveOptions} options options */ constructor(fileSystem, options) { /** @type {FileSystem} */ this.fileSystem = fileSystem; /** @type {ResolveOptions} */ this.options = options; let pathCache = _pathCacheByFs.get(fileSystem); if (!pathCache) { pathCache = { join: createCachedJoin(), dirname: createCachedDirname(), basename: createCachedBasename(), }; _pathCacheByFs.set(fileSystem, pathCache); } /** @type {PathCacheFunctions} */ this.pathCache = pathCache; /** @type {KnownHooks} */ this.hooks = { resolveStep: new SyncHook(["hook", "request"], "resolveStep"), noResolve: new SyncHook(["request", "error"], "noResolve"), resolve: new AsyncSeriesBailHook( ["request", "resolveContext"], "resolve", ), result: new AsyncSeriesHook(["result", "resolveContext"], "result"), }; } /** * @param {string | ResolveStepHook} name hook name or hook itself * @returns {ResolveStepHook} the hook */ ensureHook(name) { if (typeof name !== "string") { return name; } name = toCamelCase(name); if (name.startsWith("before")) { return /** @type {ResolveStepHook} */ ( this.ensureHook(name[6].toLowerCase() + name.slice(7)).withOptions({ stage: -10, }) ); } if (name.startsWith("after")) { return /** @type {ResolveStepHook} */ ( this.ensureHook(name[5].toLowerCase() + name.slice(6)).withOptions({ stage: 10, }) ); } /** @type {ResolveStepHook} */ const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; if (!hook) { /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name] = new AsyncSeriesBailHook( ["request", "resolveContext"], name, ); return /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; } return hook; } /** * @param {string | ResolveStepHook} name hook name or hook itself * @returns {ResolveStepHook} the hook */ getHook(name) { if (typeof name !== "string") { return name; } name = toCamelCase(name); if (name.startsWith("before")) { return /** @type {ResolveStepHook} */ ( this.getHook(name[6].toLowerCase() + name.slice(7)).withOptions({ stage: -10, }) ); } if (name.startsWith("after")) { return /** @type {ResolveStepHook} */ ( this.getHook(name[5].toLowerCase() + name.slice(6)).withOptions({ stage: 10, }) ); } /** @type {ResolveStepHook} */ const hook = /** @type {KnownHooks & EnsuredHooks} */ (this.hooks)[name]; if (!hook) { throw new Error(`Hook ${name} doesn't exist`); } return hook; } /** * @overload * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveContext=} resolveContext resolve context * @returns {string | false} result */ /** * @overload * @param {Context} context context information object * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveContext=} resolveContext resolve context * @returns {string | false} result */ /** * @param {Context | string | URL} context context information object, or the context path (string or `file:` URL instance) when no context is provided * @param {string | URL | ResolveContext=} parent context path (string or `file:` URL instance) or resolve context when no context is provided * @param {string | URL | ResolveContext=} specifier request string (or `file:` URL instance) or resolve context when no context is provided * @param {ResolveContext=} resolveContext resolve context * @returns {string | false} result */ resolveSync(context, parent, specifier, resolveContext) { /** @type {Error | null | undefined} */ let err; /** @type {string | false | undefined} */ let result; let sync = false; // `|| {}` so the underlying `resolve()` hits its 5-arg fast path // (skips the overload-shifting prologue) regardless of whether the // caller supplied a resolveContext. this.resolve( /** @type {Context} */ (context), /** @type {string} */ (parent), /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext) || {}, (_err, r) => { err = _err; result = r; sync = true; }, ); if (!sync) { throw new Error( "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!", ); } if (err) throw err; if (result === undefined) throw new Error("No result"); return result; } /** * @overload * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveContext=} resolveContext resolve context * @returns {Promise} result */ /** * @overload * @param {Context} context context information object * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveContext=} resolveContext resolve context * @returns {Promise} result */ /** * @param {Context | string | URL} context context information object, or the context path (string or `file:` URL instance) when no context is provided * @param {string | URL | ResolveContext=} parent context path (string or `file:` URL instance) or resolve context when no context is provided * @param {string | URL | ResolveContext=} specifier request string (or `file:` URL instance) or resolve context when no context is provided * @param {ResolveContext=} resolveContext resolve context * @returns {Promise} result */ resolvePromise(context, parent, specifier, resolveContext) { // `|| {}` ensures the 5-arg fast path inside `resolve()` is reached // even when the caller doesn't pass a resolveContext. return _withResolvers( this, /** @type {Context} */ (context), /** @type {string} */ (parent), /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext) || {}, ); } /** * @overload * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveCallback} callback callback function * @returns {void} */ /** * @overload * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveContext} resolveContext resolve context * @param {ResolveCallback} callback callback function * @returns {void} */ /** * @overload * @param {Context} context context information object * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveCallback} callback callback function * @returns {void} */ /** * @overload * @param {Context} context context information object * @param {string | URL} parent context path or a `file:` URL instance * @param {string | URL} specifier request string or a `file:` URL instance * @param {ResolveContext} resolveContext resolve context * @param {ResolveCallback} callback callback function * @returns {void} */ /** * @param {Context | string | URL} context context information object, or the context path (string or `file:` URL instance) when no context is provided * @param {string | URL | ResolveContext | ResolveCallback=} parent context path (string or `file:` URL instance) or (when no context) resolve context or callback * @param {string | URL | ResolveContext | ResolveCallback=} specifier request string (or `file:` URL instance) or (when no context) resolve context or callback * @param {ResolveContext | ResolveCallback=} resolveContext resolve context or callback when no resolve context is provided * @param {ResolveCallback=} callback callback function * @returns {void} */ resolve(context, parent, specifier, resolveContext, callback) { // Fast path for the common 5-arg call (`resolver.resolve(ctx, from, // req, resolveCtx, cb)`) — every call from `resolveSync` / // `resolvePromise` plus the vast majority of direct API callers. // PR #536 added runtime overload-shifting to support optional // `context` / `resolveContext`; that adds several `typeof` checks // per resolve which show up as a measurable instruction-count // regression on every benchmark that calls into this method. Skip // the shifting entirely when all 5 args are already well-typed. if ( typeof callback === "function" && typeof context === "object" && context !== null && typeof resolveContext === "object" && resolveContext !== null ) { // proceed straight to per-arg validation below } else { // Slow path: shift positional args based on what was supplied. // Shift when context is omitted (first positional arg is the parent, // either a string or a `file:` URL instance). if (typeof context === "string" || context instanceof URL) { // Keep an already-supplied callback (resolveSync / resolvePromise // always pass one in the 5th position). if (typeof callback !== "function") { callback = /** @type {ResolveCallback | undefined} */ ( resolveContext ); } resolveContext = /** @type {ResolveContext | ResolveCallback | undefined} */ ( specifier ); specifier = /** @type {string} */ (parent); parent = context; context = {}; } // 4-arg form: the resolveContext slot holds the callback. if (typeof resolveContext === "function") { callback = resolveContext; resolveContext = {}; } else if (!resolveContext || typeof resolveContext !== "object") { resolveContext = {}; } if (typeof callback !== "function") { throw new TypeError("callback argument is not a function"); } if (!context || typeof context !== "object") { context = {}; } } // Accept `file:` URL instances for parent/specifier, converting to a // filesystem path (mirrors the URL support in resolve options). The // `instanceof` check sits on the error branch, so the common string // case keeps its single `typeof` check on this hot path. if (typeof parent !== "string") { if (parent instanceof URL) parent = toPath(parent); else return callback(new Error("path argument is not a string")); } if (typeof specifier !== "string") { if (specifier instanceof URL) specifier = toPath(specifier); else return callback(new Error("request argument is not a string")); } /** @type {ResolveRequest} */ const obj = { context, path: parent, request: specifier, }; /** @type {ResolveContextYield | undefined} */ let yield_; let yieldCalled = false; /** @type {ResolveContextYield | undefined} */ let finishYield; if (typeof resolveContext.yield === "function") { const old = resolveContext.yield; /** * @param {ResolveRequest} obj object */ yield_ = (obj) => { old(obj); yieldCalled = true; }; /** * @param {ResolveRequest} result result * @returns {void} */ finishYield = (result) => { if (result) { /** @type {ResolveContextYield} */ (yield_)(result); } callback(null); }; } /** * @param {ResolveRequest} result result * @returns {void} */ const finishResolved = (result) => { const resultPath = result.path; if (resultPath === false) return callback(null, false, result); const escapedPath = resultPath.includes("#") ? resultPath.replace(HASH_ESCAPE_RE, "\0#") : resultPath; const resultQuery = result.query; let escapedQuery; if (resultQuery) { escapedQuery = resultQuery.includes("#") ? resultQuery.replace(HASH_ESCAPE_RE, "\0#") : resultQuery; } else { escapedQuery = ""; } return callback( null, `${escapedPath}${escapedQuery}${result.fragment || ""}`, result, ); }; /** * @param {string} message resolve message * @param {string[]} log logs * @returns {void} */ const finishWithoutResolve = (message, log) => { /** * @type {ErrorWithDetail} */ const error = new Error(`Can't ${message}`); error.details = log.join("\n"); this.hooks.noResolve.call(obj, error); return callback(error); }; if (resolveContext.log) { const message = `resolve '${specifier}' in '${parent}'`; // We need log anyway to capture it in case of an error const parentLog = resolveContext.log; /** @type {string[]} */ const log = []; return this.doResolve( this.hooks.resolve, obj, message, { log: (msg) => { parentLog(msg); log.push(msg); }, yield: yield_, fileDependencies: resolveContext.fileDependencies, contextDependencies: resolveContext.contextDependencies, missingDependencies: resolveContext.missingDependencies, stack: resolveContext.stack, }, (err, result) => { if (err) return callback(err); if (yieldCalled || (result && yield_)) { return /** @type {ResolveContextYield} */ (finishYield)( /** @type {ResolveRequest} */ (result), ); } if (result) return finishResolved(result); return finishWithoutResolve(message, log); }, ); } // Try to resolve assuming there is no error // We don't log stuff in this case // When there is no yield wrapper, the caller's resolveContext can // be passed directly — its `log` is already falsy (we are in the // !log branch) and `yield` is undefined, so a fresh wrapper would // be an identical copy. const rc = yield_ ? { log: undefined, yield: yield_, fileDependencies: resolveContext.fileDependencies, contextDependencies: resolveContext.contextDependencies, missingDependencies: resolveContext.missingDependencies, stack: resolveContext.stack, } : resolveContext; return this.doResolve(this.hooks.resolve, obj, null, rc, (err, result) => { if (err) return callback(err); if (yieldCalled || (result && yield_)) { return /** @type {ResolveContextYield} */ (finishYield)( /** @type {ResolveRequest} */ (result), ); } if (result) return finishResolved(result); // log is missing for the error details // so we redo the resolving for the log info // this is more expensive to the success case // is assumed by default const message = `resolve '${specifier}' in '${parent}'`; /** @type {string[]} */ const log = []; return this.doResolve( this.hooks.resolve, obj, message, { log: (msg) => log.push(msg), yield: yield_, stack: resolveContext.stack, }, (err, result) => { if (err) return callback(err); // In a case that there is a race condition and yield will be called if (yieldCalled || (result && yield_)) { return /** @type {ResolveContextYield} */ (finishYield)( /** @type {ResolveRequest} */ (result), ); } return finishWithoutResolve(message, log); }, ); }); } /** * @param {ResolveStepHook} hook hook * @param {ResolveRequest} request request * @param {null | string} message string * @param {ResolveContext} resolveContext resolver context * @param {(err?: null | Error, result?: ResolveRequest) => void} callback callback * @returns {void} */ doResolve(hook, request, message, resolveContext, callback) { const rawStack = resolveContext.stack; /** @type {StackEntry | undefined} */ let parent; /** @type {Set | undefined} */ let preSeeded; if (rawStack instanceof StackEntry) { parent = rawStack; preSeeded = rawStack.preSeeded; } else if (rawStack) { // TODO in the next major remove `Set` support in favor of `StackEntry` // Legacy `stack: new Set()` API: don't link the Set into // the parent chain (it would pollute iteration and field-compare // walks). Carry the strings on the StackEntry itself instead so // deeper `doResolve` calls keep seeing pre-seeded entries. preSeeded = /** @type {Set} */ (rawStack); } // Prepend a new linked-list node. O(1) allocation, no Set clone. const stackEntry = Resolver.createStackEntry( hook, request, parent, preSeeded, ); // When `parent` exists, its `has()` already consults `preSeeded` // (inherited from the same chain), so we only need the direct Set // lookup on the very first `doResolve` call (no parent yet). if ( parent !== undefined ? parent.has(stackEntry) : preSeeded !== undefined && preSeeded.has(stackEntry.toString()) ) { /** * Prevent recursion * @type {Error & { recursion?: boolean }} */ const recursionError = new Error( `Recursion in resolving\nStack:\n ${[...stackEntry].join("\n ")}`, ); recursionError.recursion = true; if (resolveContext.log) { resolveContext.log("abort resolving because of recursion"); } return callback(recursionError); } this.hooks.resolveStep.call(hook, request); if (hook.isUsed()) { // No-log fast path: when the context was created internally // (stack is already a StackEntry from a prior doResolve), we // can mutate stack in-place and restore it in the callback, // avoiding the createInnerContext allocation entirely. if (!resolveContext.log && rawStack instanceof StackEntry) { resolveContext.stack = stackEntry; return hook.callAsync(request, resolveContext, (err, result) => { resolveContext.stack = rawStack; if (err) return callback(err); if (result) return callback(null, result); callback(); }); } const innerContext = createInnerContext( resolveContext, stackEntry, message, ); return hook.callAsync(request, innerContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); callback(); }); } callback(); } /** * @param {string} identifier identifier * @returns {ParsedIdentifier} parsed identifier */ parse(identifier) { /** @type {ParsedIdentifier} */ const part = { request: "", query: "", fragment: "", module: false, directory: false, file: false, internal: false, }; const parsedIdentifier = parseIdentifier(identifier); if (!parsedIdentifier) return part; [part.request, part.query, part.fragment] = parsedIdentifier; if (part.request.length > 0) { // `getType` looks at the prefix of its input and the prefix is // identical between `identifier` and `part.request` in every // non-`\0`-escape case (slicing off `?query` / `#fragment` doesn't // touch the head). `parseIdentifier`'s common fast path returns // the same `identifier` reference as `parsedIdentifier[0]`, so a // pointer-equality check detects the case where we can compute // `getType` once and use it for both `module` and `internal`. The // `\0#…` escape path produces a fresh `part.request` and falls // through to the second `getType(identifier)` call to preserve // the original `internal` flag. const requestType = getType(part.request); part.module = requestType === PathType.Normal; part.internal = identifier === part.request ? requestType === PathType.Internal : getType(identifier) === PathType.Internal; // `isDirectory` is just `endsWith("/")` — inline so `parse()` // doesn't pay for the extra method dispatch on every resolve. part.directory = part.request.endsWith("/"); if (part.directory) { part.request = part.request.slice(0, -1); } } return part; } /** * @param {string} path path * @returns {boolean} true, if the path is a module */ isModule(path) { return getType(path) === PathType.Normal; } /** * @param {string} path path * @returns {boolean} true, if the path is private */ isPrivate(path) { return getType(path) === PathType.Internal; } /** * @param {string} path a path * @returns {boolean} true, if the path is a directory path */ isDirectory(path) { return path.endsWith("/"); } /** * @param {string} path path * @returns {string} normalized path */ normalize(path) { return normalize(path); } /** * @param {string} path path * @param {string} request request * @returns {string} joined path */ join(path, request) { return this.pathCache.join.fn(path, request); } /** * @param {string} path path * @returns {string} parent directory */ dirname(path) { return this.pathCache.dirname.fn(path); } /** * @param {string} path the path to evaluate * @param {string=} suffix an extension to remove from the result * @returns {string} the last portion of a path */ basename(path, suffix) { return this.pathCache.basename.fn(path, suffix); } } module.exports = Resolver; webpack-enhanced-resolve-7dfc9bc/lib/ResolverFactory.js000066400000000000000000000661561523262174200234100ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; // eslint-disable-next-line n/prefer-global/process const { versions } = require("process"); const AliasFieldPlugin = require("./AliasFieldPlugin"); const AliasPlugin = require("./AliasPlugin"); const AppendPlugin = require("./AppendPlugin"); const ConditionalPlugin = require("./ConditionalPlugin"); const DescriptionFilePlugin = require("./DescriptionFilePlugin"); const DirectoryExistsPlugin = require("./DirectoryExistsPlugin"); const ExportsFieldPlugin = require("./ExportsFieldPlugin"); const ExtensionAliasPlugin = require("./ExtensionAliasPlugin"); const FileExistsPlugin = require("./FileExistsPlugin"); const ImportsFieldPlugin = require("./ImportsFieldPlugin"); const JoinRequestPartPlugin = require("./JoinRequestPartPlugin"); const JoinRequestPlugin = require("./JoinRequestPlugin"); const MainFieldPlugin = require("./MainFieldPlugin"); const ModulesInHierarchicalDirectoriesPlugin = require("./ModulesInHierarchicalDirectoriesPlugin"); const ModulesInRootPlugin = require("./ModulesInRootPlugin"); const NextPlugin = require("./NextPlugin"); const ParsePlugin = require("./ParsePlugin"); const PnpPlugin = require("./PnpPlugin"); const Resolver = require("./Resolver"); const RestrictionsPlugin = require("./RestrictionsPlugin"); const ResultPlugin = require("./ResultPlugin"); const RootsPlugin = require("./RootsPlugin"); const SelfReferencePlugin = require("./SelfReferencePlugin"); const SymlinkPlugin = require("./SymlinkPlugin"); const SyncAsyncFileSystemDecorator = require("./SyncAsyncFileSystemDecorator"); const TryNextPlugin = require("./TryNextPlugin"); const TsconfigPathsPlugin = require("./TsconfigPathsPlugin"); const UnsafeCachePlugin = require("./UnsafeCachePlugin"); const UseFilePlugin = require("./UseFilePlugin"); const { PathType, getType, toPath } = require("./util/path"); /** @typedef {import("./AliasPlugin").AliasOption} AliasOptionEntry */ /** @typedef {import("./ExtensionAliasPlugin").ExtensionAliasOption} ExtensionAliasOption */ /** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ /** @typedef {import("./Resolver").EnsuredHooks} EnsuredHooks */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").KnownHooks} KnownHooks */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ /** @typedef {import("./UnsafeCachePlugin").Cache} Cache */ /** @typedef {string | string[] | false} AliasOptionNewRequest */ /** @typedef {{ [k: string]: AliasOptionNewRequest }} AliasOptions */ /** @typedef {string | URL | (string | URL)[] | false} UserAliasOptionNewRequest */ /** @typedef {{ [k: string]: UserAliasOptionNewRequest }} UserAliasOptions */ /** @typedef {{ alias: UserAliasOptionNewRequest, name: string, onlyModule?: boolean }} UserAliasOptionEntry */ /** @typedef {{ [k: string]: string | string[] }} ExtensionAliasOptions */ /** @typedef {false | 0 | "" | null | undefined} Falsy */ /** @typedef {{ apply: (resolver: Resolver) => void } | ((this: Resolver, resolver: Resolver) => void) | Falsy} Plugin */ /** * @typedef {object} TsconfigOptions * @property {string=} configFile A relative path to the tsconfig file based on cwd, or an absolute path of tsconfig file * @property {string[] | "auto"=} references References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths * @property {string=} baseUrl Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file */ /** * @typedef {object} UserTsconfigOptions * @property {(string | URL)=} configFile A path, or `file:` `URL` instance, pointing at the tsconfig file * @property {((string | URL)[] | "auto")=} references References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths or `file:` `URL` instances * @property {(string | URL)=} baseUrl Override baseUrl from tsconfig.json with a path or `file:` `URL` instance */ /** * @typedef {object} UserResolveOptions * @property {(UserAliasOptions | UserAliasOptionEntry[])=} alias A list of module alias configurations or an object which maps key to value * @property {(UserAliasOptions | UserAliasOptionEntry[])=} fallback A list of module alias configurations or an object which maps key to value, applied only after modules option * @property {ExtensionAliasOptions=} extensionAlias An object which maps extension to extension aliases * @property {boolean=} extensionAliasForExports Also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default (Node.js-aligned); when enabled, matches TypeScript's behavior for packages that ship TS sources alongside compiled JS. * @property {(string | string[])[]=} aliasFields A list of alias fields in description files * @property {((predicate: ResolveRequest) => boolean)=} cachePredicate A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. * @property {boolean=} cacheWithContext Whether or not the unsafeCache should include request context as part of the cache key. * @property {string[]=} descriptionFiles A list of description files to read from * @property {string[]=} conditionNames A list of exports field condition names. * @property {boolean=} enforceExtension Enforce that a extension from extensions must be used * @property {(string | string[])[]=} exportsFields A list of exports fields in description files * @property {(string | string[])[]=} importsFields A list of imports fields in description files * @property {string[]=} extensions A list of extensions which should be tried for files * @property {FileSystem} fileSystem The file system which should be used * @property {(Cache | boolean)=} unsafeCache Use this cache object to unsafely cache the successful requests * @property {boolean=} symlinks Resolve symlinks to their symlinked location * @property {Resolver=} resolver A prepared Resolver to which the plugins are attached * @property {(string | URL)[] | string | URL=} modules A list of directories to resolve modules from, can be absolute path, folder name, or a `file:` `URL` instance * @property {(string | string[] | { name: string | string[], forceRelative: boolean })[]=} mainFields A list of main fields in description files * @property {string[]=} mainFiles A list of main files in directories * @property {Plugin[]=} plugins A list of additional resolve plugins which should be applied * @property {PnpApi | null=} pnpApi A PnP API that should be used - null is "never", undefined is "auto" * @property {(string | URL)[]=} roots A list of root paths, each an absolute path or a `file:` `URL` instance * @property {boolean=} fullySpecified The request is already fully specified and no extensions or directories are resolved for it * @property {boolean=} resolveToContext Resolve to a context instead of a file * @property {(string | URL | RegExp)[]=} restrictions A list of resolve restrictions, each an absolute path, a `file:` `URL` instance, or a RegExp * @property {boolean=} useSyncFileSystemCalls Use only the sync constraints of the file system calls * @property {boolean=} preferRelative Prefer to resolve module requests as relative requests before falling back to modules * @property {boolean=} preferAbsolute Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots * @property {string | URL | boolean | UserTsconfigOptions=} tsconfig TypeScript config file path (or `file:` `URL` instance) or config object with configFile and references */ /** * @typedef {object} ResolveOptions * @property {AliasOptionEntry[]} alias alias * @property {AliasOptionEntry[]} fallback fallback * @property {Set} aliasFields alias fields * @property {ExtensionAliasOption[]} extensionAlias extension alias * @property {boolean} extensionAliasForExports apply extension alias to exports field targets * @property {(predicate: ResolveRequest) => boolean} cachePredicate cache predicate * @property {boolean} cacheWithContext cache with context * @property {Set} conditionNames A list of exports field condition names. * @property {string[]} descriptionFiles description files * @property {boolean} enforceExtension enforce extension * @property {Set} exportsFields exports fields * @property {Set} importsFields imports fields * @property {Set} extensions extensions * @property {FileSystem} fileSystem fileSystem * @property {Cache | false} unsafeCache unsafe cache * @property {boolean} symlinks symlinks * @property {Resolver=} resolver resolver * @property {(string | string[])[]} modules modules * @property {{ name: string[], forceRelative: boolean }[]} mainFields main fields * @property {Set} mainFiles main files * @property {Plugin[]} plugins plugins * @property {PnpApi | null} pnpApi pnp API * @property {Set} roots roots * @property {boolean} fullySpecified fully specified * @property {boolean} resolveToContext resolve to context * @property {Set} restrictions restrictions * @property {boolean} preferRelative prefer relative * @property {boolean} preferAbsolute prefer absolute * @property {string | boolean | TsconfigOptions} tsconfig tsconfig file path or config object */ /** * @param {PnpApi | null=} option option * @returns {PnpApi | null} processed option */ function processPnpApiOption(option) { if ( option === undefined && /** @type {NodeJS.ProcessVersions & { pnp: string }} */ versions.pnp ) { const _findPnpApi = /** @type {(issuer: string) => PnpApi | null}} */ ( // @ts-expect-error maybe nothing require("module").findPnpApi ); if (_findPnpApi) { return { resolveToUnqualified(request, issuer, opts) { const pnpapi = _findPnpApi(issuer); if (!pnpapi) { // Issuer isn't managed by PnP return null; } return pnpapi.resolveToUnqualified(request, issuer, opts); }, }; } } return option || null; } /** * @param {UserAliasOptionNewRequest} alias alias target(s) * @returns {AliasOptionNewRequest} target(s) with file `URL` instances converted to paths */ function toPathAlias(alias) { if (alias === false) return false; return Array.isArray(alias) ? alias.map(toPath) : toPath(alias); } /** * @param {UserAliasOptions | UserAliasOptionEntry[] | undefined} alias alias * @returns {AliasOptionEntry[]} normalized aliases */ function normalizeAlias(alias) { if (typeof alias === "object" && !Array.isArray(alias) && alias !== null) { return Object.keys(alias).map((key) => { /** @type {AliasOptionEntry} */ const obj = { name: key, onlyModule: false, alias: toPathAlias(alias[key]), }; if (/\$$/.test(key)) { obj.onlyModule = true; obj.name = key.slice(0, -1); } return obj; }); } return alias ? alias.map((item) => ({ ...item, alias: toPathAlias(item.alias) })) : []; } /** * @param {string | URL | boolean | UserTsconfigOptions | undefined} tsconfig tsconfig option * @returns {string | boolean | TsconfigOptions} normalized tsconfig with file `URL` instances converted to paths */ function normalizeTsconfig(tsconfig) { if (tsconfig === undefined) return false; if (typeof tsconfig === "boolean") return tsconfig; if (typeof tsconfig === "string" || tsconfig instanceof URL) { return toPath(tsconfig); } /** @type {TsconfigOptions} */ const result = {}; if (tsconfig.configFile !== undefined) { result.configFile = toPath(tsconfig.configFile); } if (tsconfig.baseUrl !== undefined) { result.baseUrl = toPath(tsconfig.baseUrl); } if (tsconfig.references !== undefined) { result.references = Array.isArray(tsconfig.references) ? tsconfig.references.map(toPath) : tsconfig.references; } return result; } /** * Merging filtered elements * @param {string[]} array source array * @param {(item: string) => boolean} filter predicate * @returns {(string | string[])[]} merge result */ function mergeFilteredToArray(array, filter) { /** @type {(string | string[])[]} */ const result = []; const set = new Set(array); for (const item of set) { if (filter(item)) { const lastElement = result.length > 0 ? result[result.length - 1] : undefined; if (Array.isArray(lastElement)) { lastElement.push(item); } else { result.push([item]); } } else { result.push(item); } } return result; } /** * @param {UserResolveOptions} options input options * @returns {ResolveOptions} output options */ function createOptions(options) { const mainFieldsSet = new Set(options.mainFields || ["main"]); /** @type {ResolveOptions["mainFields"]} */ const mainFields = []; for (const item of mainFieldsSet) { if (typeof item === "string") { mainFields.push({ name: [item], forceRelative: true, }); } else if (Array.isArray(item)) { mainFields.push({ name: item, forceRelative: true, }); } else { mainFields.push({ name: Array.isArray(item.name) ? item.name : [item.name], forceRelative: item.forceRelative, }); } } return { alias: normalizeAlias(options.alias), fallback: normalizeAlias(options.fallback), aliasFields: new Set(options.aliasFields), cachePredicate: options.cachePredicate || function trueFn() { return true; }, cacheWithContext: typeof options.cacheWithContext !== "undefined" ? options.cacheWithContext : true, exportsFields: new Set(options.exportsFields || ["exports"]), importsFields: new Set(options.importsFields || ["imports"]), conditionNames: new Set(options.conditionNames), descriptionFiles: [ ...new Set(options.descriptionFiles || ["package.json"]), ], enforceExtension: options.enforceExtension === undefined ? Boolean(options.extensions && options.extensions.includes("")) : options.enforceExtension, extensions: new Set(options.extensions || [".js", ".json", ".node"]), extensionAlias: options.extensionAlias ? Object.keys(options.extensionAlias).map((k) => ({ extension: k, alias: /** @type {ExtensionAliasOptions} */ (options.extensionAlias)[ k ], })) : [], extensionAliasForExports: options.extensionAliasForExports || false, fileSystem: options.useSyncFileSystemCalls ? new SyncAsyncFileSystemDecorator( /** @type {SyncFileSystem} */ ( /** @type {unknown} */ (options.fileSystem) ), ) : options.fileSystem, unsafeCache: options.unsafeCache && typeof options.unsafeCache !== "object" ? /** @type {Cache} */ ({}) : options.unsafeCache || false, symlinks: typeof options.symlinks !== "undefined" ? options.symlinks : true, resolver: options.resolver, modules: mergeFilteredToArray( Array.isArray(options.modules) ? options.modules.map(toPath) : options.modules ? [toPath(options.modules)] : ["node_modules"], (item) => { const type = getType(item); return type === PathType.Normal || type === PathType.Relative; }, ), mainFields, mainFiles: new Set(options.mainFiles || ["index"]), plugins: options.plugins || [], pnpApi: processPnpApiOption(options.pnpApi), roots: new Set(options.roots ? options.roots.map(toPath) : undefined), fullySpecified: options.fullySpecified || false, resolveToContext: options.resolveToContext || false, preferRelative: options.preferRelative || false, preferAbsolute: options.preferAbsolute || false, restrictions: new Set( options.restrictions && options.restrictions.map((r) => (r instanceof RegExp ? r : toPath(r))), ), tsconfig: normalizeTsconfig(options.tsconfig), }; } /** * @param {UserResolveOptions} options resolve options * @returns {Resolver} created resolver */ module.exports.createResolver = function createResolver(options) { const normalizedOptions = createOptions(options); const { alias, fallback, aliasFields, extensionAliasForExports, cachePredicate, cacheWithContext, conditionNames, descriptionFiles, enforceExtension, exportsFields, extensionAlias, importsFields, extensions, fileSystem, fullySpecified, mainFields, mainFiles, modules, plugins: userPlugins, pnpApi, resolveToContext, preferRelative, preferAbsolute, symlinks, unsafeCache, resolver: customResolver, restrictions, roots, tsconfig, } = normalizedOptions; const plugins = [...userPlugins]; const resolver = customResolver || new Resolver(fileSystem, normalizedOptions); // // pipeline //// resolver.ensureHook("resolve"); resolver.ensureHook("internalResolve"); resolver.ensureHook("newInternalResolve"); resolver.ensureHook("importsResolve"); resolver.ensureHook("parsedResolve"); resolver.ensureHook("describedResolve"); resolver.ensureHook("rawResolve"); resolver.ensureHook("normalResolve"); resolver.ensureHook("internal"); resolver.ensureHook("rawModule"); resolver.ensureHook("alternateRawModule"); resolver.ensureHook("module"); resolver.ensureHook("resolveAsModule"); resolver.ensureHook("undescribedResolveInPackage"); resolver.ensureHook("resolveInPackage"); resolver.ensureHook("resolveInExistingDirectory"); resolver.ensureHook("importsFieldRelative"); if (extensionAliasForExports) { resolver.ensureHook("exportsFieldRelative"); } resolver.ensureHook("relative"); resolver.ensureHook("describedRelative"); resolver.ensureHook("directory"); resolver.ensureHook("undescribedExistingDirectory"); resolver.ensureHook("existingDirectory"); resolver.ensureHook("undescribedRawFile"); resolver.ensureHook("rawFile"); resolver.ensureHook("file"); resolver.ensureHook("finalFile"); resolver.ensureHook("existingFile"); resolver.ensureHook("resolved"); // TODO remove in next major // cspell:word Interal // Backward-compat // @ts-expect-error resolver.hooks.newInteralResolve = resolver.hooks.newInternalResolve; // resolve for (const { source, resolveOptions } of [ { source: "resolve", resolveOptions: { fullySpecified } }, { source: "internal-resolve", resolveOptions: { fullySpecified: false } }, // Entry point for non-relative targets from the imports field. // Sets internal: false to prevent re-entering imports resolution, // aligning with the Node.js ESM spec where PACKAGE_IMPORTS_RESOLVE // does not recursively resolve # specifiers. // https://nodejs.org/api/esm.html#resolution-algorithm-specification { source: "imports-resolve", resolveOptions: { fullySpecified: false, internal: false }, }, ]) { plugins.push(new ParsePlugin(source, resolveOptions, "parsed-resolve")); } // parsed-resolve plugins.push( new DescriptionFilePlugin( "parsed-resolve", descriptionFiles, false, "described-resolve", ), ); plugins.push(new NextPlugin("after-parsed-resolve", "described-resolve")); // described-resolve if (unsafeCache) { plugins.push( new UnsafeCachePlugin( "described-resolve", cachePredicate, /** @type {import("./UnsafeCachePlugin").Cache} */ (unsafeCache), cacheWithContext, "raw-resolve", ), ); } else { plugins.push(new NextPlugin("described-resolve", "raw-resolve")); } if (fallback.length > 0) { plugins.push( new AliasPlugin("described-resolve", fallback, "internal-resolve"), ); } // raw-resolve if (alias.length > 0) { plugins.push(new AliasPlugin("raw-resolve", alias, "internal-resolve")); } if (tsconfig) { plugins.push(new TsconfigPathsPlugin(tsconfig)); } for (const item of aliasFields) { plugins.push(new AliasFieldPlugin("raw-resolve", item, "internal-resolve")); } for (const item of extensionAlias) { plugins.push( new ExtensionAliasPlugin("raw-resolve", item, "normal-resolve"), ); } plugins.push(new NextPlugin("raw-resolve", "normal-resolve")); // normal-resolve if (preferRelative) { plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); } plugins.push( new ConditionalPlugin( "after-normal-resolve", { module: true }, "resolve as module", false, "raw-module", ), ); plugins.push( new ConditionalPlugin( "after-normal-resolve", { internal: true }, "resolve as internal import", false, "internal", ), ); if (preferAbsolute) { plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); } if (roots.size > 0) { plugins.push(new RootsPlugin("after-normal-resolve", roots, "relative")); } if (!preferRelative && !preferAbsolute) { plugins.push(new JoinRequestPlugin("after-normal-resolve", "relative")); } // internal for (const importsField of importsFields) { plugins.push( new ImportsFieldPlugin( "internal", conditionNames, importsField, "imports-field-relative", "imports-resolve", ), ); } // imports-field-relative: apply extensionAlias to paths produced by the // imports field (TypeScript-style extension substitution for self-package // imports like `#foo` -> `./foo.js` -> `./foo.ts`). Unlike the exports // field, the imports field is internal to the package, so applying the // consumer's extension aliases does not expose files the package author // did not intend to export. See issue #413. for (const item of extensionAlias) { plugins.push( new ExtensionAliasPlugin("imports-field-relative", item, "relative"), ); } plugins.push(new NextPlugin("imports-field-relative", "relative")); // raw-module for (const exportsField of exportsFields) { plugins.push( new SelfReferencePlugin("raw-module", exportsField, "resolve-as-module"), ); } for (const item of modules) { if (Array.isArray(item)) { if (item.includes("node_modules") && pnpApi) { plugins.push( new ModulesInHierarchicalDirectoriesPlugin( "raw-module", item.filter((i) => i !== "node_modules"), "module", ), ); plugins.push( new PnpPlugin( "raw-module", pnpApi, "undescribed-resolve-in-package", "alternate-raw-module", ), ); plugins.push( new ModulesInHierarchicalDirectoriesPlugin( "alternate-raw-module", ["node_modules"], "module", ), ); } else { plugins.push( new ModulesInHierarchicalDirectoriesPlugin( "raw-module", item, "module", ), ); } } else { plugins.push(new ModulesInRootPlugin("raw-module", item, "module")); } } // module plugins.push(new JoinRequestPartPlugin("module", "resolve-as-module")); // resolve-as-module if (!resolveToContext) { plugins.push( new ConditionalPlugin( "resolve-as-module", { directory: false, request: "." }, "single file module", true, "undescribed-raw-file", ), ); } plugins.push( new DirectoryExistsPlugin( "resolve-as-module", "undescribed-resolve-in-package", ), ); // undescribed-resolve-in-package plugins.push( new DescriptionFilePlugin( "undescribed-resolve-in-package", descriptionFiles, false, "resolve-in-package", ), ); plugins.push( new NextPlugin( "after-undescribed-resolve-in-package", "resolve-in-package", ), ); // resolve-in-package const exportsFieldTarget = extensionAliasForExports ? "exports-field-relative" : "relative"; for (const exportsField of exportsFields) { plugins.push( new ExportsFieldPlugin( "resolve-in-package", conditionNames, exportsField, exportsFieldTarget, restrictions.size > 0, ), ); } plugins.push( new NextPlugin("resolve-in-package", "resolve-in-existing-directory"), ); // exports-field-relative (opt-in via `extensionAliasForExports`): // apply `extensionAlias` to paths produced by the exports field. This is // off by default to match Node.js (which does not substitute extensions on // bare-module targets), and on opt-in aligns with TypeScript for packages // that ship TS sources alongside the compiled JS they list in `exports`. if (extensionAliasForExports) { for (const item of extensionAlias) { plugins.push( new ExtensionAliasPlugin("exports-field-relative", item, "relative"), ); } plugins.push(new NextPlugin("exports-field-relative", "relative")); } // resolve-in-existing-directory plugins.push( new JoinRequestPlugin("resolve-in-existing-directory", "relative"), ); // relative plugins.push( new DescriptionFilePlugin( "relative", descriptionFiles, true, "described-relative", ), ); plugins.push(new NextPlugin("after-relative", "described-relative")); // described-relative if (resolveToContext) { plugins.push(new NextPlugin("described-relative", "directory")); } else { plugins.push( new ConditionalPlugin( "described-relative", { directory: false }, null, true, "raw-file", ), ); plugins.push( new ConditionalPlugin( "described-relative", { fullySpecified: false }, "as directory", true, "directory", ), ); } // directory plugins.push( new DirectoryExistsPlugin("directory", "undescribed-existing-directory"), ); if (resolveToContext) { // undescribed-existing-directory plugins.push(new NextPlugin("undescribed-existing-directory", "resolved")); } else { // undescribed-existing-directory plugins.push( new DescriptionFilePlugin( "undescribed-existing-directory", descriptionFiles, false, "existing-directory", ), ); for (const item of mainFiles) { plugins.push( new UseFilePlugin( "undescribed-existing-directory", item, "undescribed-raw-file", ), ); } // described-existing-directory for (const item of mainFields) { plugins.push( new MainFieldPlugin( "existing-directory", item, "resolve-in-existing-directory", ), ); } for (const item of mainFiles) { plugins.push( new UseFilePlugin("existing-directory", item, "undescribed-raw-file"), ); } // undescribed-raw-file plugins.push( new DescriptionFilePlugin( "undescribed-raw-file", descriptionFiles, true, "raw-file", ), ); plugins.push(new NextPlugin("after-undescribed-raw-file", "raw-file")); // raw-file plugins.push( new ConditionalPlugin( "raw-file", { fullySpecified: true }, null, false, "file", ), ); if (!enforceExtension) { plugins.push(new TryNextPlugin("raw-file", "no extension", "file")); } for (const item of extensions) { plugins.push(new AppendPlugin("raw-file", item, "file")); } // file if (alias.length > 0) { plugins.push(new AliasPlugin("file", alias, "internal-resolve")); } for (const item of aliasFields) { plugins.push(new AliasFieldPlugin("file", item, "internal-resolve")); } plugins.push(new NextPlugin("file", "final-file")); // final-file plugins.push(new FileExistsPlugin("final-file", "existing-file")); // existing-file if (symlinks) { plugins.push(new SymlinkPlugin("existing-file", "existing-file")); } plugins.push(new NextPlugin("existing-file", "resolved")); } const { resolved } = /** @type {KnownHooks & EnsuredHooks} */ (resolver.hooks); // resolved if (restrictions.size > 0) { plugins.push(new RestrictionsPlugin(resolved, restrictions)); } plugins.push(new ResultPlugin(resolved)); // // RESOLVER //// for (const plugin of plugins) { if (typeof plugin === "function") { /** @type {(this: Resolver, resolver: Resolver) => void} */ (plugin).call(resolver, resolver); } else if (plugin) { plugin.apply(resolver); } } return resolver; }; webpack-enhanced-resolve-7dfc9bc/lib/RestrictionsPlugin.js000066400000000000000000000046301523262174200241130ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const { isInside, normalize } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** * @typedef {object} PathRestriction * @property {"path"} type type of the restriction * @property {string} rule normalized path the request has to be inside of */ /** * @typedef {object} RegExpRestriction * @property {"regexp"} type type of the restriction * @property {RegExp} rule pattern the request has to match */ /** @typedef {PathRestriction | RegExpRestriction} Restriction */ module.exports = class RestrictionsPlugin { /** * @param {string | ResolveStepHook} source source * @param {Set} restrictions restrictions */ constructor(source, restrictions) { this.source = source; this.restrictions = restrictions; // Restrictions never change, so bringing them into the shape requests // arrive in is done once here instead of on every request. /** @type {Restriction[]} */ this._restrictions = []; for (const rule of restrictions) { this._restrictions.push( typeof rule === "string" ? { type: "path", rule: normalize(rule) } : { type: "regexp", rule }, ); } } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { resolver .getHook(this.source) .tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => { if (typeof request.path === "string") { const { path } = request; for (const restriction of this._restrictions) { if (restriction.type === "path") { if (isInside(restriction.rule, path)) continue; if (resolveContext.log) { resolveContext.log( `${path} is not inside of the restriction ${restriction.rule}`, ); } } else { if (restriction.rule.test(path)) continue; if (resolveContext.log) { resolveContext.log( `${path} doesn't match the restriction ${restriction.rule}`, ); } } // Target existed (FileExistsPlugin already passed) but is // outside the jail; signal ExportsFieldPlugin to fall back. if (request.__restrictionsMarker) { request.__restrictionsMarker.blocked = true; } return callback(null, null); } } callback(); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/ResultPlugin.js000066400000000000000000000017261523262174200227040ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class ResultPlugin { /** * @param {ResolveStepHook} source source */ constructor(source) { this.source = source; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { this.source.tapAsync( "ResultPlugin", (request, resolverContext, callback) => { const obj = { ...request }; if (resolverContext.log) { resolverContext.log(`reporting result ${obj.path}`); } resolver.hooks.result.callAsync(obj, resolverContext, (err) => { if (err) return callback(err); if (typeof resolverContext.yield === "function") { resolverContext.yield(obj); callback(null, null); } else { callback(null, obj); } }); }, ); } }; webpack-enhanced-resolve-7dfc9bc/lib/RootsPlugin.js000066400000000000000000000031661523262174200225340ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const forEachBail = require("./forEachBail"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ class RootsPlugin { /** * @param {string | ResolveStepHook} source source hook * @param {Set} roots roots * @param {string | ResolveStepHook} target target hook */ constructor(source, roots, target) { this.roots = [...roots]; this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("RootsPlugin", (request, resolveContext, callback) => { const req = request.request; if (!req) return callback(); if (!req.startsWith("/")) return callback(); forEachBail( this.roots, /** * @param {string} root root * @param {(err?: null | Error, result?: null | ResolveRequest) => void} callback callback * @returns {void} */ (root, callback) => { const path = resolver.join(root, req.slice(1)); /** @type {ResolveRequest} */ const obj = { ...request, path, relativePath: request.relativePath && path, }; resolver.doResolve( target, obj, `root path ${root}`, resolveContext, callback, ); }, callback, ); }); } } module.exports = RootsPlugin; webpack-enhanced-resolve-7dfc9bc/lib/SelfReferencePlugin.js000066400000000000000000000062111523262174200241300ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const DescriptionFileUtils = require("./DescriptionFileUtils"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").JsonObject} JsonObject */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ const slashCode = "/".charCodeAt(0); // Sentinel stored in `_nameCache` when the description file either has no // exports field (so self-reference can't apply) or no string `name`. const NO_SELF_REF = Symbol("NoSelfRef"); module.exports = class SelfReferencePlugin { /** * @param {string | ResolveStepHook} source source * @param {string | string[]} fieldNamePath name path * @param {string | ResolveStepHook} target target */ constructor(source, fieldNamePath, target) { this.source = source; this.target = target; this.fieldName = fieldNamePath; // Self-reference needs both an exports field and a `"name"` string. // Both are stable per description-file content, so cache the decision // in one WeakMap: the resolved name when self-reference is possible, // or `NO_SELF_REF` when it isn't. This skips the two per-resolve // `DescriptionFileUtils.getField` walks for hot packages. /** @type {WeakMap} */ this._nameCache = new WeakMap(); } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("SelfReferencePlugin", (request, resolveContext, callback) => { if (!request.descriptionFileData) return callback(); const req = request.request; if (!req) return callback(); const { descriptionFileData } = request; let name = this._nameCache.get(descriptionFileData); if (name === undefined) { // Feature is only enabled when an exports field is present const exportsField = DescriptionFileUtils.getField( descriptionFileData, this.fieldName, ); if (!exportsField) { this._nameCache.set(descriptionFileData, NO_SELF_REF); return callback(); } const rawName = DescriptionFileUtils.getField( descriptionFileData, "name", ); if (typeof rawName !== "string") { this._nameCache.set(descriptionFileData, NO_SELF_REF); return callback(); } name = rawName; this._nameCache.set(descriptionFileData, name); } else if (name === NO_SELF_REF) { return callback(); } if ( req.startsWith(name) && (req.length === name.length || req.charCodeAt(name.length) === slashCode) ) { const remainingRequest = `.${req.slice(name.length)}`; /** @type {ResolveRequest} */ const obj = { ...request, request: remainingRequest, path: /** @type {string} */ (request.descriptionFileRoot), relativePath: ".", }; resolver.doResolve( target, obj, "self reference", resolveContext, callback, ); } else { return callback(); } }); } }; webpack-enhanced-resolve-7dfc9bc/lib/SymlinkPlugin.js000066400000000000000000000103031523262174200230430ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const forEachBail = require("./forEachBail"); const { getPathsCached } = require("./getPaths"); const { PathType, getType } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class SymlinkPlugin { /** * @param {string | ResolveStepHook} source source * @param {string | ResolveStepHook} target target */ constructor(source, target) { this.source = source; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); const fs = resolver.fileSystem; resolver .getHook(this.source) .tapAsync("SymlinkPlugin", (request, resolveContext, callback) => { if (request.ignoreSymlinks) return callback(); const pathsResult = getPathsCached( fs, /** @type {string} */ (request.path), ); const { paths, segments } = pathsResult; // `pathsResult.segments` is shared across callers via the cache. // The only place we need to mutate is `pathSegments[idx] = result` // when `fs.readlink` succeeds — which is rare (the vast majority // of paths contain no symlinks, e.g. every resolve on // `cache-predicate`'s no-symlink fixture). Defer the copy until // we actually see a symlink so the common no-symlink path stays // allocation-free. /** @type {string[] | null} */ let pathSegments = null; let containsSymlink = false; let idx = -1; forEachBail( paths, /** * @param {string} path path * @param {(err?: null | Error, result?: null | number) => void} callback callback * @returns {void} */ (path, callback) => { idx++; if (resolveContext.fileDependencies) { resolveContext.fileDependencies.add(path); } fs.readlink(path, (err, result) => { if (!err && result) { // First symlink seen — take our own copy now, so // the cached `segments` array stays pristine for // sibling resolves. if (pathSegments === null) { pathSegments = [...segments]; } pathSegments[idx] = /** @type {string} */ (result); containsSymlink = true; // Shortcut when absolute symlink found const resultType = getType(result.toString()); if ( resultType === PathType.AbsoluteWin || resultType === PathType.AbsolutePosix ) { return callback(null, idx); } } callback(); }); }, /** * @param {null | Error=} err error * @param {null | number=} idx result * @returns {void} */ (err, idx) => { if (!containsSymlink) return callback(); // `containsSymlink === true` implies we took a copy in // `pathSegments` already, so it's non-null. The copy is // our own, so `slice` to trim is fine and spreading to // "unshare" is no longer necessary. const own = /** @type {string[]} */ (pathSegments); const resultSegments = typeof idx === "number" ? own.slice(0, idx + 1) : own; const result = resultSegments.reduceRight((a, b) => resolver.join(a, b), ); /** @type {ResolveRequest} */ const obj = { ...request, path: result, }; resolver.doResolve( target, obj, `resolved symlink to ${result}`, resolveContext, (err, innerResult) => { if (err) return callback(err); // The symlink-resolved (real) path is authoritative. If // resolving it produced a result, use it. If it did not — // e.g. a `restrictions` rule rejected the real target — // stop here with no result instead of letting the next // plugin report the original in-root symlink path, which // would leave the symlink unresolved and bypass // `restrictions`. if (innerResult) return callback(null, innerResult); return callback(null, null); }, ); }, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/SyncAsyncFileSystemDecorator.js000066400000000000000000000136461523262174200260350ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").StringCallback} StringCallback */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ // eslint-disable-next-line jsdoc/reject-function-type /** @typedef {Function} SyncOrAsyncFunction */ // eslint-disable-next-line jsdoc/reject-any-type /** @typedef {any} ResultOfSyncOrAsyncFunction */ /** * @param {SyncFileSystem} fs file system implementation * @constructor */ function SyncAsyncFileSystemDecorator(fs) { this.fs = fs; this.lstat = undefined; this.lstatSync = undefined; const { lstatSync } = fs; if (lstatSync) { this.lstat = /** @type {FileSystem["lstat"]} */ ( (arg, options, callback) => { let result; try { result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? lstatSync.call(fs, arg, options) : lstatSync.call(fs, arg); } catch (err) { return (callback || options)( /** @type {NodeJS.ErrnoException | null} */ (err), ); } (callback || options)( null, /** @type {ResultOfSyncOrAsyncFunction} */ (result), ); } ); this.lstatSync = /** @type {SyncFileSystem["lstatSync"]} */ ((arg, options) => lstatSync.call(fs, arg, options)); } this.stat = /** @type {FileSystem["stat"]} */ ( (arg, options, callback) => { let result; try { result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.statSync(arg, options) : fs.statSync(arg); } catch (err) { return (callback || options)( /** @type {NodeJS.ErrnoException | null} */ (err), ); } (callback || options)( null, /** @type {ResultOfSyncOrAsyncFunction} */ (result), ); } ); this.statSync = /** @type {SyncFileSystem["statSync"]} */ ((arg, options) => fs.statSync(arg, options)); this.readdir = /** @type {FileSystem["readdir"]} */ ( (arg, options, callback) => { let result; try { result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.readdirSync( arg, /** @type {Exclude[1], (err: NodeJS.ErrnoException | null, files: string[]) => void>} */ (options), ) : fs.readdirSync(arg); } catch (err) { return (callback || options)( /** @type {NodeJS.ErrnoException | null} */ (err), [], ); } (callback || options)( null, /** @type {ResultOfSyncOrAsyncFunction} */ (result), ); } ); this.readdirSync = /** @type {SyncFileSystem["readdirSync"]} */ ( (arg, options) => fs.readdirSync( arg, /** @type {Parameters[1]} */ (options), ) ); this.readFile = /** @type {FileSystem["readFile"]} */ ( (arg, options, callback) => { let result; try { result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.readFileSync(arg, options) : fs.readFileSync(arg); } catch (err) { return (callback || options)( /** @type {NodeJS.ErrnoException | null} */ (err), ); } (callback || options)( null, /** @type {ResultOfSyncOrAsyncFunction} */ (result), ); } ); this.readFileSync = /** @type {SyncFileSystem["readFileSync"]} */ ((arg, options) => fs.readFileSync(arg, options)); this.readlink = /** @type {FileSystem["readlink"]} */ ( (arg, options, callback) => { let result; try { result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? fs.readlinkSync( arg, /** @type {Exclude[1], StringCallback>} */ (options), ) : fs.readlinkSync(arg); } catch (err) { return (callback || options)( /** @type {NodeJS.ErrnoException | null} */ (err), ); } (callback || options)( null, /** @type {ResultOfSyncOrAsyncFunction} */ (result), ); } ); this.readlinkSync = /** @type {SyncFileSystem["readlinkSync"]} */ ( (arg, options) => fs.readlinkSync( arg, /** @type {Parameters[1]} */ ( options ), ) ); this.readJson = undefined; this.readJsonSync = undefined; const { readJsonSync } = fs; if (readJsonSync) { this.readJson = /** @type {FileSystem["readJson"]} */ ( (arg, callback) => { let result; try { result = readJsonSync.call(fs, arg); } catch (err) { return callback( /** @type {NodeJS.ErrnoException | Error | null} */ (err), ); } callback(null, result); } ); this.readJsonSync = /** @type {SyncFileSystem["readJsonSync"]} */ ((arg) => readJsonSync.call(fs, arg)); } this.realpath = undefined; this.realpathSync = undefined; const { realpathSync } = fs; if (realpathSync) { this.realpath = /** @type {FileSystem["realpath"]} */ ( (arg, options, callback) => { let result; try { result = /** @type {SyncOrAsyncFunction | undefined} */ (callback) ? realpathSync.call( fs, arg, /** @type {Exclude>[1], StringCallback>} */ (options), ) : realpathSync.call(fs, arg); } catch (err) { return (callback || options)( /** @type {NodeJS.ErrnoException | null} */ (err), ); } (callback || options)( null, /** @type {ResultOfSyncOrAsyncFunction} */ (result), ); } ); this.realpathSync = /** @type {SyncFileSystem["realpathSync"]} */ ( (arg, options) => realpathSync.call( fs, arg, /** @type {Parameters>[1]} */ (options), ) ); } } module.exports = SyncAsyncFileSystemDecorator; webpack-enhanced-resolve-7dfc9bc/lib/TryNextPlugin.js000066400000000000000000000016301523262174200230350ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class TryNextPlugin { /** * @param {string | ResolveStepHook} source source * @param {string} message message * @param {string | ResolveStepHook} target target */ constructor(source, message, target) { this.source = source; this.message = message; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("TryNextPlugin", (request, resolveContext, callback) => { resolver.doResolve( target, request, this.message, resolveContext, callback, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/TsconfigPathsPlugin.js000066400000000000000000000671671523262174200242150ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Natsu @xiaoxiaojx */ "use strict"; const { aliasResolveHandler, compileAliasOptions } = require("./AliasUtils"); const { modulesResolveHandler } = require("./ModulesUtils"); const { readJson } = require("./util/fs"); const { PathType: _PathType, isSubPath, normalize } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./AliasUtils").AliasOption} AliasOption */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").TsconfigPathsData} TsconfigPathsData */ /** @typedef {import("./Resolver").TsconfigPathsMap} TsconfigPathsMap */ /** @typedef {import("./ResolverFactory").TsconfigOptions} TsconfigOptions */ // Sentinel stored in `_contextSelectionCache` for `requestPath`s whose // scan returned `null` ("no context matched"). Using a non-null marker // lets the cache-hit path be a single `Map.get()` — we distinguish // "cached null" from "not cached yet" without a second `has` lookup. const NULL_CONTEXT = Symbol("NULL_CONTEXT"); /** * Per-`TsconfigPathsMap` memoization of `_selectPathsDataForContext`. * * Real-world builds resolve hundreds of requests per source file (every * import in the file), and webpack-style resolvers walk the same * `requestPath` (= source-file directory) for each one. Without this * cache every resolve re-scans the full `contextList` even though the * answer is invariant for a given `(map, requestPath)` pair. * * The outer key is the `TsconfigPathsMap` itself — rebuilt on every * tsconfig change — so a `WeakMap` lets the inner map be collected * automatically once the map goes away. The inner Map is keyed by * `requestPath` (string); a `Symbol` sentinel stands in for "no * matching context" so `Map.get` alone distinguishes the three states * (cached data / cached null / not cached). * @type {WeakMap>} */ const _contextSelectionCache = new WeakMap(); /** * @typedef {object} TsconfigCompilerOptions * @property {string=} baseUrl Base URL for resolving paths * @property {{ [key: string]: string[] }=} paths TypeScript paths mapping */ /** * @typedef {object} TsconfigReference * @property {string} path Path to the referenced project */ /** * @typedef {object} Tsconfig * @property {TsconfigCompilerOptions=} compilerOptions Compiler options * @property {string | string[]=} extends Extended configuration paths * @property {TsconfigReference[]=} references Project references */ const DEFAULT_CONFIG_FILE = "tsconfig.json"; const READ_JSON_OPTIONS = { stripComments: true }; // Trailing `/*` or `\*` segment of a tsconfig `paths` mapping (e.g. // `./src/*` → `./src`). Hoisted so we don't allocate a fresh regex per // path entry on every tsconfig load — and so the same regex object can be // reused for the matching `test` + `replace` pair below. const WILDCARD_TAIL_RE = /[/\\]\*$/; /** * @param {string} pattern Path pattern * @returns {number} Length of the prefix */ function getPrefixLength(pattern) { const prefixLength = pattern.indexOf("*"); if (prefixLength === -1) { return pattern.length; } return prefixLength; } /** * Sort path patterns. * If a module name can be matched with multiple patterns then pattern with the longest prefix will be picked. * @param {string[]} arr Array of path patterns * @returns {string[]} Array of path patterns sorted by longest prefix */ function sortByLongestPrefix(arr) { return [...arr].sort((a, b) => getPrefixLength(b) - getPrefixLength(a)); } /** * Merge two tsconfig objects * @param {Tsconfig | null} base base config * @param {Tsconfig | null} config config to merge * @returns {Tsconfig} merged config */ function mergeTsconfigs(base, config) { base = base || {}; config = config || {}; return { ...base, ...config, compilerOptions: { .../** @type {TsconfigCompilerOptions} */ (base.compilerOptions), .../** @type {TsconfigCompilerOptions} */ (config.compilerOptions), }, }; } /** * Substitute ${configDir} template variable in path * @param {string} pathValue the path value * @param {string} configDir the config directory * @returns {string} the path with substituted template */ function substituteConfigDir(pathValue, configDir) { // eslint-disable-next-line no-template-curly-in-string if (!pathValue.includes("${configDir}")) return pathValue; return pathValue.replace(/\$\{configDir\}/g, configDir); } /** * Convert tsconfig paths to resolver options * @param {string} configDir Config file directory * @param {{ [key: string]: string[] }} paths TypeScript paths mapping * @param {Resolver} resolver resolver instance * @param {string=} baseUrl Base URL for resolving paths (relative to configDir) * @returns {TsconfigPathsData} the resolver options */ function tsconfigPathsToResolveOptions(configDir, paths, resolver, baseUrl) { // Calculate absolute base URL const absoluteBaseUrl = !baseUrl ? configDir : resolver.join(configDir, baseUrl); /** @type {string[]} */ const sortedKeys = sortByLongestPrefix(Object.keys(paths)); /** @type {AliasOption[]} */ const alias = []; /** @type {string[]} */ const modules = []; for (const pattern of sortedKeys) { const mappings = paths[pattern]; // Substitute ${configDir} in path mappings const absolutePaths = mappings.map((mapping) => { const substituted = substituteConfigDir(mapping, configDir); return resolver.join(absoluteBaseUrl, substituted); }); if (absolutePaths.length > 0) { if (pattern === "*") { // Pull `dir/*` entries directly into `modules` with their // trailing wildcard stripped, skipping anything else. The // previous `.map(...).filter(Boolean)` form allocated two // throwaway arrays plus a spread iterator per `*` mapping. for (let j = 0; j < absolutePaths.length; j++) { const dir = absolutePaths[j]; if (WILDCARD_TAIL_RE.test(dir)) { modules.push(dir.replace(WILDCARD_TAIL_RE, "")); } } } else { alias.push({ name: pattern, alias: absolutePaths }); } } } if (baseUrl && absoluteBaseUrl && !modules.includes(absoluteBaseUrl)) { modules.push(absoluteBaseUrl); } return { alias: compileAliasOptions(resolver, alias), modules, }; } /** * Get the base context for the current project * @param {string} context the context * @param {Resolver} resolver resolver instance * @param {string=} baseUrl base URL for resolving paths * @returns {string} the base context */ function getAbsoluteBaseUrl(context, resolver, baseUrl) { return !baseUrl ? context : resolver.join(context, baseUrl); } /** * @param {TsconfigPathsData} main main paths data * @param {string} mainContext main context * @param {{ [baseUrl: string]: TsconfigPathsData }} refs references map * @param {Set} fileDependencies file dependencies * @returns {TsconfigPathsMap} the tsconfig paths map */ function buildTsconfigPathsMap(main, mainContext, refs, fileDependencies) { const allContexts = /** @type {{ [context: string]: TsconfigPathsData }} */ ({ [mainContext]: main, ...refs, }); // Precompute the key list once per tsconfig load. `_selectPathsDataForContext` // runs per resolve and otherwise would call `Object.entries(allContexts)` // each time, allocating a fresh [key, value][] array. const contextList = Object.keys(allContexts); return { main, mainContext, refs, allContexts, contextList, fileDependencies, }; } module.exports = class TsconfigPathsPlugin { /** * @param {true | string | TsconfigOptions} configFileOrOptions tsconfig file path or options object */ constructor(configFileOrOptions) { if ( typeof configFileOrOptions === "object" && configFileOrOptions !== null ) { // Options object format const { configFile } = configFileOrOptions; /** @type {boolean} */ this.isAutoConfigFile = typeof configFile !== "string"; /** @type {string} */ this.configFile = this.isAutoConfigFile ? DEFAULT_CONFIG_FILE : /** @type {string} */ (configFile); /** @type {string[] | "auto"} */ if (Array.isArray(configFileOrOptions.references)) { /** @type {TsconfigReference[] | "auto"} */ this.references = configFileOrOptions.references.map((ref) => ({ path: ref, })); } else if (configFileOrOptions.references === "auto") { this.references = "auto"; } else { this.references = []; } /** @type {string | undefined} */ this.baseUrl = configFileOrOptions.baseUrl; } else { /** @type {boolean} */ this.isAutoConfigFile = configFileOrOptions === true; /** @type {string} */ this.configFile = this.isAutoConfigFile ? DEFAULT_CONFIG_FILE : /** @type {string} */ (configFileOrOptions); /** @type {TsconfigReference[] | "auto"} */ this.references = []; /** @type {string | undefined} */ this.baseUrl = undefined; } } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const aliasTarget = resolver.ensureHook("internal-resolve"); const moduleTarget = resolver.ensureHook("module"); resolver .getHook("raw-resolve") .tapAsync("TsconfigPathsPlugin", (request, resolveContext, callback) => { this._getTsconfigPathsMap( resolver, request, resolveContext, (err, tsconfigPathsMap) => { if (err) return callback(err); if (!tsconfigPathsMap) return callback(); const selectedData = this._selectPathsDataForContext( request.path, tsconfigPathsMap, ); if (!selectedData) return callback(); aliasResolveHandler( resolver, selectedData.alias, aliasTarget, request, resolveContext, (err, result) => { if (err) return callback(err); if (result) return callback(null, result); // https://github.com/webpack/webpack/issues/20944 // Unlike resolve.alias, tsconfig paths should fall through // when a pattern matches but the mapped path does not exist // (matching TypeScript's native resolution behavior). return callback(); }, ); }, ); }); resolver .getHook("raw-module") .tapAsync("TsconfigPathsPlugin", (request, resolveContext, callback) => { this._getTsconfigPathsMap( resolver, request, resolveContext, (err, tsconfigPathsMap) => { if (err) return callback(err); if (!tsconfigPathsMap) return callback(); const selectedData = this._selectPathsDataForContext( request.path, tsconfigPathsMap, ); if (!selectedData) return callback(); modulesResolveHandler( resolver, selectedData.modules, moduleTarget, request, resolveContext, callback, ); }, ); }); } /** * Get TsconfigPathsMap for the request (with caching) * @param {Resolver} resolver the resolver * @param {ResolveRequest} request the request * @param {ResolveContext} resolveContext the resolve context * @param {(err: Error | null, result?: TsconfigPathsMap | null) => void} callback the callback * @returns {void} */ _getTsconfigPathsMap(resolver, request, resolveContext, callback) { if (typeof request.tsconfigPathsMap !== "undefined") { const cached = request.tsconfigPathsMap; if (!cached) return callback(null, null); if (resolveContext.fileDependencies) { for (const fileDependency of cached.fileDependencies) { resolveContext.fileDependencies.add(fileDependency); } } return callback(null, cached); } if (this.isAutoConfigFile) { this._findTsconfigUpward( resolver, request.path || process.cwd(), (err, result) => { if (err) { request.tsconfigPathsMap = null; return callback(err); } if (!result) { request.tsconfigPathsMap = null; return callback(null, null); } const map = /** @type {TsconfigPathsMap} */ (result); request.tsconfigPathsMap = map; if (resolveContext.fileDependencies) { for (const fileDependency of map.fileDependencies) { resolveContext.fileDependencies.add(fileDependency); } } callback(null, map); }, ); return; } const absTsconfigPath = resolver.join( request.path || process.cwd(), this.configFile, ); this._loadTsconfigPathsMap(resolver, absTsconfigPath, (err, result) => { if (err) { request.tsconfigPathsMap = null; return callback(err); } const map = /** @type {TsconfigPathsMap} */ (result); request.tsconfigPathsMap = map; if (resolveContext.fileDependencies) { for (const fileDependency of map.fileDependencies) { resolveContext.fileDependencies.add(fileDependency); } } callback(null, map); }); } /** * Walk up from startDir to the filesystem root looking for tsconfig.json. * Like TypeScript's own `findConfigFile` / `forEachAncestorDirectory`. * @param {Resolver} resolver the resolver * @param {string} startDir the directory to start searching from * @param {(err: Error | null, result?: TsconfigPathsMap | null) => void} callback the callback * @returns {void} */ _findTsconfigUpward(resolver, startDir, callback) { const { fileSystem } = resolver; const configFileName = this.configFile; /** * @param {string} dir current directory * @returns {void} */ const check = (dir) => { const candidate = resolver.join(dir, configFileName); fileSystem.stat(candidate, (statErr) => { if (!statErr) { // Found — load it this._loadTsconfigPathsMap(resolver, candidate, (loadErr, result) => { if (loadErr) { // Auto mode: soft-fail silently. return callback(null, null); } callback(null, result); }); return; } // Not found — move to parent const parentDir = resolver.dirname(dir); if (parentDir === dir) { // Reached filesystem root, no tsconfig.json found return callback(null, null); } check(parentDir); }); }; check(startDir); } /** * Load tsconfig.json and build complete TsconfigPathsMap * Includes main project paths and all referenced projects * @param {Resolver} resolver the resolver * @param {string} absTsconfigPath absolute path to tsconfig.json * @param {(err: Error | null, result?: TsconfigPathsMap) => void} callback the callback * @returns {void} */ _loadTsconfigPathsMap(resolver, absTsconfigPath, callback) { /** @type {Set} */ const fileDependencies = new Set(); this._loadTsconfig( resolver, absTsconfigPath, fileDependencies, undefined, (err, config) => { if (err) return callback(err); const cfg = /** @type {Tsconfig} */ (config); const compilerOptions = cfg.compilerOptions || {}; const mainContext = resolver.dirname(absTsconfigPath); const baseUrl = this.baseUrl !== undefined ? this.baseUrl : compilerOptions.baseUrl; const main = tsconfigPathsToResolveOptions( mainContext, compilerOptions.paths || {}, resolver, baseUrl, ); /** @type {{ [baseUrl: string]: TsconfigPathsData }} */ const refs = {}; let referencesToUse = null; if (this.references === "auto") { referencesToUse = cfg.references; } else if (Array.isArray(this.references)) { referencesToUse = this.references; } if (!Array.isArray(referencesToUse)) { return callback( null, buildTsconfigPathsMap(main, mainContext, refs, fileDependencies), ); } this._loadTsconfigReferences( resolver, mainContext, referencesToUse, fileDependencies, refs, (refErr) => { if (refErr) return callback(refErr); callback( null, buildTsconfigPathsMap(main, mainContext, refs, fileDependencies), ); }, ); }, ); } /** * Select the correct TsconfigPathsData based on request.path (context-aware) * Matches the behavior of tsconfig-paths-webpack-plugin * @param {string | false} requestPath the request path * @param {TsconfigPathsMap} tsconfigPathsMap the tsconfig paths map * @returns {TsconfigPathsData | null} the selected paths data */ _selectPathsDataForContext(requestPath, tsconfigPathsMap) { const { main, allContexts, contextList } = tsconfigPathsMap; if (!requestPath) { return main; } // Single-context tsconfigs (no project references) hit the loop // below at most once; in that case the cache lookup costs more // than the loop itself. Only memoize when there are 2+ contexts // — that's the monorepo / project-references shape where the // scan actually walks multiple entries per resolve and the // `(map, requestPath)` answer can be reused. /** @type {Map | undefined} */ let perMap; if (contextList.length >= 2) { perMap = _contextSelectionCache.get(tsconfigPathsMap); if (perMap !== undefined) { const cached = perMap.get(requestPath); if (cached !== undefined) { return cached === NULL_CONTEXT ? null : /** @type {TsconfigPathsData} */ (cached); } } else { perMap = new Map(); _contextSelectionCache.set(tsconfigPathsMap, perMap); } } let longestMatchContext = null; let longestMatchLength = 0; // Iterate the pre-computed key list (the previous // `Object.entries(allContexts)` form allocated a fresh // `[key, value][]` per resolve). Defer the `allContexts[context]` // lookup to after we know the context actually matches — non-matches // are the common case and don't need the property access. for (let i = 0; i < contextList.length; i++) { const context = contextList[i]; if (context === requestPath) { const exact = allContexts[context]; if (perMap !== undefined) perMap.set(requestPath, exact); return exact; } // Cheap integer-compare gate first: a context can only beat the // current longest match if its own length is strictly greater. // Skipping `isSubPath` (a `startsWith` + char-code probe) when the // length already disqualifies the candidate avoids the per-resolve // scan over every shorter context. if ( context.length > longestMatchLength && isSubPath(context, requestPath) ) { longestMatchContext = context; longestMatchLength = context.length; } } const result = longestMatchContext === null ? null : allContexts[longestMatchContext]; if (perMap !== undefined) { perMap.set(requestPath, result === null ? NULL_CONTEXT : result); } return result; } /** * Load tsconfig from extends path * @param {Resolver} resolver the resolver * @param {string} configFilePath current config file path * @param {string} extendedConfigValue extends value * @param {Set} fileDependencies the file dependencies * @param {Set} visitedConfigPaths config paths being loaded (for circular extends detection) * @param {(err: Error | null, result?: Tsconfig) => void} callback callback * @returns {void} */ _loadTsconfigFromExtends( resolver, configFilePath, extendedConfigValue, fileDependencies, visitedConfigPaths, callback, ) { const { fileSystem } = resolver; const currentDir = resolver.dirname(configFilePath); // Substitute ${configDir} in extends path extendedConfigValue = substituteConfigDir(extendedConfigValue, currentDir); // Remember the original value before potentially appending .json const originalExtendedConfigValue = extendedConfigValue; if ( typeof extendedConfigValue === "string" && !extendedConfigValue.includes(".json") ) { extendedConfigValue += ".json"; } const initialExtendedConfigPath = resolver.join( currentDir, extendedConfigValue, ); /** * @param {string} extendedConfigPath resolved config path to load */ const loadExtended = (extendedConfigPath) => { this._loadTsconfig( resolver, extendedConfigPath, fileDependencies, visitedConfigPaths, (err, config) => { if (err) return callback(err); const cfg = /** @type {Tsconfig} */ (config); const compilerOptions = cfg.compilerOptions || { baseUrl: undefined, }; if (compilerOptions.baseUrl) { const extendedConfigDir = resolver.dirname(extendedConfigPath); compilerOptions.baseUrl = getAbsoluteBaseUrl( extendedConfigDir, resolver, compilerOptions.baseUrl, ); } delete cfg.references; callback(null, cfg); }, ); }; fileSystem.stat(initialExtendedConfigPath, (existsErr) => { if (!existsErr) return loadExtended(initialExtendedConfigPath); // The relative form does not exist — treat the value as a package // specifier and compute its `node_modules/<...>` sub-path. let nodeModulesSubPath = null; if ( typeof originalExtendedConfigValue === "string" && originalExtendedConfigValue.startsWith("@") && originalExtendedConfigValue.split("/").length === 2 ) { // Scoped package, no sub-path ("@scope/name") → // node_modules/@scope/name/tsconfig.json (not @scope/name.json). // See: test/fixtures/tsconfig-paths/extends-pkg-entry/ nodeModulesSubPath = `${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`; } else if ( extendedConfigValue.includes("/") && !originalExtendedConfigValue.startsWith(".") && !originalExtendedConfigValue.startsWith("/") ) { // Package sub-path ("react/tsconfig", "@scope/name/tsconfig") → // node_modules/react/tsconfig.json. // See: test/fixtures/tsconfig-paths/extends-npm/ nodeModulesSubPath = extendedConfigValue; } else if ( !originalExtendedConfigValue.startsWith(".") && !originalExtendedConfigValue.startsWith("/") ) { // Unscoped package, no sub-path ("my-base-config") → // node_modules/my-base-config/tsconfig.json. nodeModulesSubPath = `${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`; } // Not a package specifier (relative/absolute) — load the missing // path anyway so the read surfaces its own ENOENT. if (nodeModulesSubPath === null) { return loadExtended(initialExtendedConfigPath); } // Walk ancestor node_modules like Node.js/TypeScript so a package // hoisted to a parent workspace directory is found. #21457 const subPath = normalize(`node_modules/${nodeModulesSubPath}`); this._findExtendsInNodeModules(resolver, currentDir, subPath, (found) => { loadExtended(found || resolver.join(currentDir, subPath)); }); }); } /** * Walk up from startDir looking for `/` (a * `node_modules/...` sub-path), matching Node.js module resolution so a * package hoisted to a parent workspace's node_modules is found. * @param {Resolver} resolver the resolver * @param {string} startDir directory to start searching from * @param {string} subPath node_modules-relative sub-path to look for * @param {(found: string | null) => void} callback receives the found path or null * @returns {void} */ _findExtendsInNodeModules(resolver, startDir, subPath, callback) { const { fileSystem } = resolver; /** * @param {string} dir current directory */ const check = (dir) => { const candidate = resolver.join(dir, subPath); fileSystem.stat(candidate, (statErr) => { if (!statErr) return callback(candidate); const parentDir = resolver.dirname(dir); if (parentDir === dir) return callback(null); check(parentDir); }); }; check(startDir); } /** * Load referenced tsconfig projects and store in referenceMatchMap * Simple implementation matching tsconfig-paths-webpack-plugin: * Just load each reference and store independently * @param {Resolver} resolver the resolver * @param {string} context the context * @param {TsconfigReference[]} references array of references * @param {Set} fileDependencies the file dependencies * @param {{ [baseUrl: string]: TsconfigPathsData }} referenceMatchMap the map to populate * @param {(err: Error | null) => void} callback callback * @param {Set=} visitedRefPaths visited reference config paths (for circular reference detection) * @returns {void} */ _loadTsconfigReferences( resolver, context, references, fileDependencies, referenceMatchMap, callback, visitedRefPaths, ) { if (references.length === 0) return callback(null); const visited = visitedRefPaths || new Set(); let pending = references.length; const finishOne = () => { if (--pending === 0) callback(null); }; for (const ref of references) { const refPath = substituteConfigDir(ref.path, context); const refConfigPath = resolver.join( resolver.join(context, refPath), DEFAULT_CONFIG_FILE, ); if (visited.has(refConfigPath)) { finishOne(); continue; } visited.add(refConfigPath); this._loadTsconfig( resolver, refConfigPath, fileDependencies, undefined, (err, refConfig) => { // Failures are swallowed to match tsconfig-paths-webpack-plugin: // a broken reference must not abort the main project's resolution. if (err) return finishOne(); const cfg = /** @type {Tsconfig} */ (refConfig); if (cfg.compilerOptions && cfg.compilerOptions.paths) { const refContext = resolver.dirname(refConfigPath); referenceMatchMap[refContext] = tsconfigPathsToResolveOptions( refContext, cfg.compilerOptions.paths || {}, resolver, cfg.compilerOptions.baseUrl, ); } if (this.references === "auto" && Array.isArray(cfg.references)) { this._loadTsconfigReferences( resolver, resolver.dirname(refConfigPath), cfg.references, fileDependencies, referenceMatchMap, finishOne, visited, ); } else { finishOne(); } }, ); } } /** * Load tsconfig.json with extends support * @param {Resolver} resolver the resolver * @param {string} configFilePath absolute path to tsconfig.json * @param {Set} fileDependencies the file dependencies * @param {Set | undefined} visitedConfigPaths config paths being loaded (for circular extends detection) * @param {(err: Error | null, result?: Tsconfig) => void} callback callback * @returns {void} */ _loadTsconfig( resolver, configFilePath, fileDependencies, visitedConfigPaths, callback, ) { const visited = visitedConfigPaths || new Set(); if (visited.has(configFilePath)) { return callback(null, /** @type {Tsconfig} */ ({})); } visited.add(configFilePath); readJson( resolver.fileSystem, configFilePath, READ_JSON_OPTIONS, (err, parsed) => { if (err) return callback(/** @type {Error} */ (err)); const config = /** @type {Tsconfig} */ (parsed); fileDependencies.add(configFilePath); const extendedConfig = config.extends; if (!extendedConfig) return callback(null, config); if (!Array.isArray(extendedConfig)) { this._loadTsconfigFromExtends( resolver, configFilePath, extendedConfig, fileDependencies, visited, (extErr, extendedTsconfig) => { if (extErr) return callback(extErr); callback( null, mergeTsconfigs( /** @type {Tsconfig} */ (extendedTsconfig), config, ), ); }, ); return; } /** @type {Tsconfig} */ let base = {}; let i = 0; const next = () => { if (i >= extendedConfig.length) { return callback(null, mergeTsconfigs(base, config)); } this._loadTsconfigFromExtends( resolver, configFilePath, extendedConfig[i++], fileDependencies, visited, (extErr, extendedTsconfig) => { if (extErr) return callback(extErr); base = mergeTsconfigs( base, /** @type {Tsconfig} */ (extendedTsconfig), ); next(); }, ); }; next(); }, ); } }; webpack-enhanced-resolve-7dfc9bc/lib/UnsafeCachePlugin.js000066400000000000000000000133121523262174200235650ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { isRelativeRequest } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ /** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */ /** @typedef {{ [k: string]: undefined | ResolveRequest | ResolveRequest[] }} Cache */ /** * @param {string} relativePath relative path from package root * @param {string} request relative request * @param {Resolver} resolver resolver instance * @returns {string} normalized request with a preserved leading dot */ function joinRelativePreservingLeadingDot(relativePath, request, resolver) { const normalized = resolver.join(relativePath, request); return isRelativeRequest(normalized) ? normalized : `./${normalized}`; } /** * @param {ResolveRequest} request request * @returns {string | false | undefined} normalized path */ function getCachePath(request) { if (request.descriptionFileRoot && !request.module) { return request.descriptionFileRoot; } return request.path; } /** * @param {ResolveRequest} request request * @param {Resolver} resolver resolver instance * @returns {string | undefined} normalized request string */ function getCacheRequest(request, resolver) { const requestString = request.request; if ( !requestString || !request.relativePath || !isRelativeRequest(requestString) ) { return requestString; } return joinRelativePreservingLeadingDot( request.relativePath, requestString, resolver, ); } // Cache-key separator: `\0` is safe because paths, requests, queries and // fragments produced by `parseIdentifier` never contain a raw NUL (the // \0-escape in identifier.js is decoded back to the original char), and the // context, when included, is passed through `JSON.stringify`, which escapes // any NUL to \u0000. // const SEP = "\0"; /** * Build the cache id for a request. Called on every `described-resolve` * invocation when `unsafeCache` is on, so it's a hot path. * * Equivalent in meaning to the previous `JSON.stringify({ ... })` form, but * ~3–5× faster since we avoid the object allocation and JSON serializer for * the fields that are already plain strings. * @param {string} type type of cache * @param {ResolveRequest} request request * @param {boolean} withContext cache with context? * @param {Resolver} resolver resolver instance * @returns {string} cache id */ function getCacheId(type, request, withContext, resolver) { // TODO use it in the next major release, it is faster // const contextPart = withContext ? JSON.stringify(request.context) : ""; // const path = getCachePath(request); // const cacheRequest = getCacheRequest(request, resolver); // return ( // type + // SEP + // contextPart + // SEP + // (path || "") + // SEP + // (request.query || "") + // SEP + // (request.fragment || "") + // SEP + // (cacheRequest || "") // ); return JSON.stringify({ type, context: withContext ? request.context : "", path: getCachePath(request), query: request.query, fragment: request.fragment, request: getCacheRequest(request, resolver), }); } module.exports = class UnsafeCachePlugin { /** * @param {string | ResolveStepHook} source source * @param {(request: ResolveRequest) => boolean} filterPredicate filterPredicate * @param {Cache} cache cache * @param {boolean} withContext withContext * @param {string | ResolveStepHook} target target */ constructor(source, filterPredicate, cache, withContext, target) { this.source = source; this.filterPredicate = filterPredicate; this.withContext = withContext; this.cache = cache; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => { if (!this.filterPredicate(request)) { return resolver.doResolve( target, request, null, resolveContext, callback, ); } const isYield = typeof resolveContext.yield === "function"; const cacheId = getCacheId( isYield ? "yield" : "default", request, this.withContext, resolver, ); const cacheEntry = this.cache[cacheId]; if (cacheEntry) { if (isYield) { const yield_ = /** @type {ResolveContextYield} */ (resolveContext.yield); if (Array.isArray(cacheEntry)) { for (const result of cacheEntry) yield_(result); } else { yield_(cacheEntry); } return callback(null, null); } return callback(null, /** @type {ResolveRequest} */ (cacheEntry)); } /** @type {ResolveContextYield | undefined} */ let yieldFn; /** @type {ResolveContextYield | undefined} */ let yield_; /** @type {ResolveRequest[]} */ const yieldResult = []; if (isYield) { yieldFn = resolveContext.yield; yield_ = (result) => { yieldResult.push(result); }; } resolver.doResolve( target, request, null, yield_ ? { ...resolveContext, yield: yield_ } : resolveContext, (err, result) => { if (err) return callback(err); if (isYield) { if (result) yieldResult.push(result); for (const result of yieldResult) { /** @type {ResolveContextYield} */ (yieldFn)(result); } this.cache[cacheId] = yieldResult; return callback(null, null); } if (result) return callback(null, (this.cache[cacheId] = result)); callback(); }, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/UseFilePlugin.js000066400000000000000000000024421523262174200227560ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */ module.exports = class UseFilePlugin { /** * @param {string | ResolveStepHook} source source * @param {string} filename filename * @param {string | ResolveStepHook} target target */ constructor(source, filename, target) { this.source = source; this.filename = filename; this.target = target; } /** * @param {Resolver} resolver the resolver * @returns {void} */ apply(resolver) { const target = resolver.ensureHook(this.target); resolver .getHook(this.source) .tapAsync("UseFilePlugin", (request, resolveContext, callback) => { const filePath = resolver.join( /** @type {string} */ (request.path), this.filename, ); /** @type {ResolveRequest} */ const obj = { ...request, path: filePath, relativePath: request.relativePath && resolver.join(request.relativePath, this.filename), }; resolver.doResolve( target, obj, `using path: ${filePath}`, resolveContext, callback, ); }); } }; webpack-enhanced-resolve-7dfc9bc/lib/createInnerContext.js000066400000000000000000000034331523262174200240500ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** * Build the `ResolveContext` passed into the next hook in the chain. * * The caller — `Resolver.doResolve` — runs on every resolve step, so we * want to allocate as little as possible here. Previously the caller * constructed a temporary `{ log, yield, fileDependencies, ... }` literal * and handed it to this helper, which then copied those same fields into * a second fresh object. That's two allocations per step for what is * effectively a struct copy with one mutated field (`stack`) and one * optionally-wrapped field (`log`). Taking the parent context and the * two things we actually want to change (stack, message) as separate * arguments lets us allocate exactly one inner context. * @param {ResolveContext} parent parent resolve context to inherit dependency sets / yield from * @param {ResolveContext["stack"]} stack new stack tip for the nested call * @param {null | string} message log message prefix for this step * @returns {ResolveContext} inner context */ module.exports = function createInnerContext(parent, stack, message) { const parentLog = parent.log; let innerLog; if (parentLog) { if (message) { let messageReported = false; /** * @param {string} msg message */ innerLog = (msg) => { if (!messageReported) { parentLog(message); messageReported = true; } parentLog(` ${msg}`); }; } else { innerLog = parentLog; } } return { log: innerLog, yield: parent.yield, fileDependencies: parent.fileDependencies, contextDependencies: parent.contextDependencies, missingDependencies: parent.missingDependencies, stack, }; }; webpack-enhanced-resolve-7dfc9bc/lib/forEachBail.js000066400000000000000000000021541523262174200224020ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** * @template T * @template Z * @callback Iterator * @param {T} item item * @param {(err?: null | Error, result?: null | Z) => void} callback callback * @param {number} i index * @returns {void} */ /** * @template T * @template Z * @param {T[]} array array * @param {Iterator} iterator iterator * @param {(err?: null | Error, result?: null | Z, i?: number) => void} callback callback after all items are iterated * @returns {void} */ module.exports = function forEachBail(array, iterator, callback) { if (array.length === 0) return callback(); let i = 0; const next = () => { /** @type {boolean | undefined} */ let loop; iterator( array[i++], (err, result) => { if (err || result !== undefined || i >= array.length) { return callback(err, result, i); } if (loop === false) while (next()); loop = true; }, i, ); if (!loop) loop = false; return loop; }; while (next()); }; webpack-enhanced-resolve-7dfc9bc/lib/getInnerRequest.js000066400000000000000000000023521523262174200233670ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const { isRelativeRequest } = require("./util/path"); /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** * @param {Resolver} resolver resolver * @param {ResolveRequest} request string * @returns {string} inner request */ module.exports = function getInnerRequest(resolver, request) { if ( typeof request.__innerRequest === "string" && request.__innerRequest_request === request.request && request.__innerRequest_relativePath === request.relativePath ) { return request.__innerRequest; } /** @type {string | undefined} */ let innerRequest; if (request.request) { innerRequest = request.request; if (request.relativePath && isRelativeRequest(innerRequest)) { innerRequest = resolver.join(request.relativePath, innerRequest); } } else { innerRequest = request.relativePath; } // eslint-disable-next-line camelcase request.__innerRequest_request = request.request; // eslint-disable-next-line camelcase request.__innerRequest_relativePath = request.relativePath; return (request.__innerRequest = /** @type {string} */ (innerRequest)); }; webpack-enhanced-resolve-7dfc9bc/lib/getPaths.js000066400000000000000000000055101523262174200220210ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {{ paths: string[], segments: string[] }} GetPathsResult */ /** * Walk `path` from tip to root, returning every ancestor directory (plus the * input itself) in `paths`, and each corresponding segment name in `segments`. * * The return value may be shared across callers via `getPathsCached` — treat * it as read-only. Callers that need to mutate (currently only * `SymlinkPlugin`) should `slice()` the arrays locally before writing. * @param {string} path path * @returns {GetPathsResult} paths and segments */ function getPaths(path) { if (path === "/") return { paths: ["/"], segments: [""] }; const parts = path.split(/(.*?[\\/]+)/); const paths = [path]; const segments = [parts[parts.length - 1]]; let part = parts[parts.length - 1]; path = path.slice(0, Math.max(0, path.length - part.length - 1)); for (let i = parts.length - 2; i > 2; i -= 2) { paths.push(path); part = parts[i]; path = path.slice(0, Math.max(0, path.length - part.length)) || "/"; segments.push(part.slice(0, -1)); } [, part] = parts; segments.push(part); paths.push(part); return { paths, segments, }; } /** * Per-filesystem memoization of `getPaths`. Kept in a standalone WeakMap * rather than being hung off `resolver.pathCache` so that adding this cache * does not change the hidden-class shape of `pathCache` — which is accessed * on the hot path of every resolve as `resolver.pathCache.{join,dirname, * basename}.fn(...)`. CodSpeed caught that shape change as a ~1–2% * instruction-count regression on `cache-predicate`, so we keep pathCache * shape-stable by owning this cache here instead. * * The cache lifetime is tied to the filesystem object (same invariant as * `_pathCacheByFs` in `Resolver.js`): when the user swaps filesystems the * entries become unreachable and get collected. * @type {WeakMap>} */ const _getPathsCacheByFs = new WeakMap(); /** * Memoized `getPaths`. The returned object is shared across callers — do * not mutate the `paths` or `segments` arrays in-place; `slice()` first if * you need a mutable copy. * @param {FileSystem} fileSystem filesystem used as the cache namespace * @param {string} path path * @returns {GetPathsResult} paths and segments */ function getPathsCached(fileSystem, path) { let cache = _getPathsCacheByFs.get(fileSystem); if (cache === undefined) { cache = new Map(); _getPathsCacheByFs.set(fileSystem, cache); } else { const cached = cache.get(path); if (cached !== undefined) return cached; } const result = getPaths(path); cache.set(path, result); return result; } module.exports = getPaths; module.exports.getPathsCached = getPathsCached; webpack-enhanced-resolve-7dfc9bc/lib/index.js000066400000000000000000000231211523262174200213470ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const memoize = require("./util/memoize"); /** @typedef {import("./CachedInputFileSystem").BaseFileSystem} BaseFileSystem */ /** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */ /** @typedef {import("./Resolver")} Resolver */ /** @typedef {import("./Resolver").Context} Context */ /** @typedef {import("./Resolver").FileSystem} FileSystem */ /** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */ /** @typedef {import("./Resolver").ResolveContext} ResolveContext */ /** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ /** @typedef {import("./ResolverFactory").Plugin} Plugin */ /** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */ /** * @typedef {{ * (context: Context, parent: string | URL, specifier: string | URL, resolveContext: ResolveContext, callback: ResolveCallback): void, * (context: Context, parent: string | URL, specifier: string | URL, callback: ResolveCallback): void, * (parent: string | URL, specifier: string | URL, resolveContext: ResolveContext, callback: ResolveCallback): void, * (parent: string | URL, specifier: string | URL, callback: ResolveCallback): void, * }} ResolveFunctionAsync */ /** * @typedef {{ * (context: Context, parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): string | false, * (parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): string | false, * }} ResolveFunction */ /** * @typedef {{ * (context: Context, parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): Promise, * (parent: string | URL, specifier: string | URL, resolveContext?: ResolveContext): Promise, * }} ResolveFunctionPromise */ const getCachedFileSystem = memoize(() => require("./CachedInputFileSystem")); const getNodeFileSystem = memoize(() => { const fs = require("graceful-fs"); const CachedInputFileSystem = getCachedFileSystem(); return new CachedInputFileSystem(fs, 4000); }); const getNodeContext = memoize(() => ({ environments: ["node+es3+es5+process+native"], })); const getResolverFactory = memoize(() => require("./ResolverFactory")); const getAsyncResolver = memoize(() => getResolverFactory().createResolver({ conditionNames: ["node"], extensions: [".js", ".json", ".node"], fileSystem: getNodeFileSystem(), }), ); /** * @type {ResolveFunctionAsync} */ const resolve = /** * @param {object | string | URL} context context * @param {string | URL} parent parent path * @param {string | URL | ResolveContext | ResolveCallback} specifier specifier to resolve * @param {ResolveContext | ResolveCallback=} resolveContext resolve context * @param {ResolveCallback=} callback callback */ (context, parent, specifier, resolveContext, callback) => { if (typeof context === "string" || context instanceof URL) { callback = /** @type {ResolveCallback} */ (resolveContext); resolveContext = /** @type {ResolveContext} */ (specifier); specifier = parent; parent = context; context = getNodeContext(); } if (typeof callback !== "function") { callback = /** @type {ResolveCallback} */ (resolveContext); } getAsyncResolver().resolve( context, parent, /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext), /** @type {ResolveCallback} */ (callback), ); }; const getSyncResolver = memoize(() => getResolverFactory().createResolver({ conditionNames: ["node"], extensions: [".js", ".json", ".node"], useSyncFileSystemCalls: true, fileSystem: getNodeFileSystem(), }), ); /** * @type {ResolveFunction} */ const resolveSync = /** * @param {object | string | URL} context context * @param {string | URL} parent parent path * @param {string | URL | ResolveContext | undefined} specifier specifier to resolve * @param {ResolveContext=} resolveContext resolve context * @returns {string | false} resolved path */ (context, parent, specifier, resolveContext) => { if (typeof context === "string" || context instanceof URL) { resolveContext = /** @type {ResolveContext} */ (specifier); specifier = parent; parent = context; context = getNodeContext(); } return getSyncResolver().resolveSync( context, parent, /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext), ); }; /** * @type {ResolveFunctionPromise} */ const resolvePromise = /** * @param {object | string | URL} context context * @param {string | URL} parent parent path * @param {string | URL | ResolveContext | undefined} specifier specifier to resolve * @param {ResolveContext=} resolveContext resolve context * @returns {Promise} resolved path */ (context, parent, specifier, resolveContext) => { if (typeof context === "string" || context instanceof URL) { resolveContext = /** @type {ResolveContext} */ (specifier); specifier = parent; parent = context; context = getNodeContext(); } return getAsyncResolver().resolvePromise( context, parent, /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext), ); }; /** @typedef {Omit & Partial>} ResolveOptionsOptionalFS */ /** * @param {ResolveOptionsOptionalFS} options Resolver options * @returns {ResolveFunctionAsync} Resolver function */ function create(options) { const resolver = getResolverFactory().createResolver({ ...options, fileSystem: options.fileSystem || getNodeFileSystem(), }); /** * @param {object | string | URL} context Custom context * @param {string | URL} parent Base/parent path * @param {string | URL | ResolveContext | ResolveCallback} specifier Specifier to resolve * @param {ResolveContext | ResolveCallback=} resolveContext Resolve context * @param {ResolveCallback=} callback Result callback */ return function create(context, parent, specifier, resolveContext, callback) { if (typeof context === "string" || context instanceof URL) { callback = /** @type {ResolveCallback} */ (resolveContext); resolveContext = /** @type {ResolveContext} */ (specifier); specifier = parent; parent = context; context = getNodeContext(); } if (typeof callback !== "function") { callback = /** @type {ResolveCallback} */ (resolveContext); } resolver.resolve( context, parent, /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext), callback, ); }; } /** * @param {ResolveOptionsOptionalFS} options Resolver options * @returns {ResolveFunction} Resolver function */ function createSync(options) { const resolver = getResolverFactory().createResolver({ useSyncFileSystemCalls: true, ...options, fileSystem: options.fileSystem || getNodeFileSystem(), }); /** * @param {object | string | URL} context custom context * @param {string | URL} parent base/parent path * @param {string | URL | ResolveContext | undefined} specifier specifier to resolve * @param {ResolveContext=} resolveContext Resolve context * @returns {string | false} Resolved path or false */ return function createSync(context, parent, specifier, resolveContext) { if (typeof context === "string" || context instanceof URL) { resolveContext = /** @type {ResolveContext} */ (specifier); specifier = parent; parent = context; context = getNodeContext(); } return resolver.resolveSync( context, parent, /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext), ); }; } /** * @param {ResolveOptionsOptionalFS} options Resolver options * @returns {ResolveFunctionPromise} Resolver function */ function createPromise(options) { const resolver = getResolverFactory().createResolver({ ...options, fileSystem: options.fileSystem || getNodeFileSystem(), }); /** * @param {object | string | URL} context Custom context * @param {string | URL} parent Base/parent path * @param {string | URL | ResolveContext | undefined} specifier Specifier to resolve * @param {ResolveContext=} resolveContext Resolve context * @returns {Promise} resolved path */ return function createPromise(context, parent, specifier, resolveContext) { if (typeof context === "string" || context instanceof URL) { resolveContext = /** @type {ResolveContext} */ (specifier); specifier = parent; parent = context; context = getNodeContext(); } return resolver.resolvePromise( context, parent, /** @type {string} */ (specifier), /** @type {ResolveContext} */ (resolveContext), ); }; } /** * @template A * @template B * @param {A} obj input a * @param {B} exports input b * @returns {A & B} merged */ const mergeExports = (obj, exports) => { const descriptors = Object.getOwnPropertyDescriptors(exports); Object.defineProperties(obj, descriptors); return /** @type {A & B} */ (Object.freeze(obj)); }; module.exports = mergeExports(resolve, { get sync() { return resolveSync; }, get promise() { return resolvePromise; }, create: mergeExports(create, { get sync() { return createSync; }, get promise() { return createPromise; }, }), get ResolverFactory() { return getResolverFactory(); }, get CachedInputFileSystem() { return getCachedFileSystem(); }, get CloneBasenamePlugin() { return require("./CloneBasenamePlugin"); }, get LogInfoPlugin() { return require("./LogInfoPlugin"); }, get TsconfigPathsPlugin() { return require("./TsconfigPathsPlugin"); }, get forEachBail() { return require("./forEachBail"); }, }); webpack-enhanced-resolve-7dfc9bc/lib/util/000077500000000000000000000000001523262174200206605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/lib/util/entrypoints.js000066400000000000000000000523171523262174200236240ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const { parseIdentifier } = require("./identifier"); /** @typedef {string | (string | ConditionalMapping)[]} DirectMapping */ /** @typedef {{ [k: string]: MappingValue }} ConditionalMapping */ /** @typedef {ConditionalMapping | DirectMapping | null} MappingValue */ /** @typedef {Record | ConditionalMapping | DirectMapping} ExportsField */ /** @typedef {Record} ImportsField */ /** * Processing exports/imports field * @callback FieldProcessor * @param {string} request request * @param {Set} conditionNames condition names * @returns {[string[], string | null]} resolved paths with used field */ /* Example exports field: { ".": "./main.js", "./feature": { "browser": "./feature-browser.js", "default": "./feature.js" } } Terminology: Enhanced-resolve name keys ("." and "./feature") as exports field keys. If value is string or string[], mapping is called as a direct mapping and value called as a direct export. If value is key-value object, mapping is called as a conditional mapping and value called as a conditional export. Key in conditional mapping is called condition name. Conditional mapping nested in another conditional mapping is called nested mapping. ---------- Example imports field: { "#a": "./main.js", "#moment": { "browser": "./moment/index.js", "default": "moment" }, "#moment/": { "browser": "./moment/", "default": "moment/" } } Terminology: Enhanced-resolve name keys ("#a" and "#moment/", "#moment") as imports field keys. If value is string or string[], mapping is called as a direct mapping and value called as a direct export. If value is key-value object, mapping is called as a conditional mapping and value called as a conditional export. Key in conditional mapping is called condition name. Conditional mapping nested in another conditional mapping is called nested mapping. */ const slashCode = "/".charCodeAt(0); const dotCode = ".".charCodeAt(0); const hashCode = "#".charCodeAt(0); const patternRegEx = /\*/g; const DOLLAR_ESCAPE_RE = /\$/g; /** @typedef {Record} RecordMapping */ /** * Cached `Object.keys()` for objects whose shape does not change after the * first observation — i.e. parsed `package.json` fields and the nested * conditional mappings inside them. `Object.keys` allocates a fresh array * on every call; since `findMatch` / `conditionalMapping` run on every * bare-specifier resolve, the allocation adds up quickly. * @type {WeakMap} */ const _keysCache = new WeakMap(); /** * @param {RecordMapping} obj object to read keys from * @returns {string[]} cached keys array (DO NOT mutate) */ function cachedKeys(obj) { let keys = _keysCache.get(obj); if (keys === undefined) { keys = Object.keys(obj); _keysCache.set(obj, keys); } return keys; } /** * Per-key precomputed info used by `findMatch`. Equivalent to what the * previous implementation recomputed inline on every resolve. * @typedef {object} FieldKeyInfo * @property {string} key the original key * @property {number} patternIndex position of the single "*" in the key, or -1 when absent * @property {string} wildcardPrefix substring before "*" (empty when patternIndex === -1) * @property {string} wildcardSuffix substring after "*" (empty when patternIndex === -1) * @property {boolean} isLegacySubpath true when key is a legacy `./foo/`-style folder key with no "*" * @property {boolean} isPattern true when key contains "*" * @property {boolean} isSubpathMapping true when key ends with "/" * @property {boolean} isValidPattern true when key has at most one "*" */ /** * Cached per-field key metadata, keyed by the exports/imports field * object. Computed lazily on first `findMatch` call and reused forever. * Safe because `package.json` fields are immutable JSON values. * @type {WeakMap} */ const _fieldKeyInfoCache = new WeakMap(); /** * @param {ExportsField | ImportsField} field field object * @returns {FieldKeyInfo[]} precomputed per-key info */ function getFieldKeyInfos(field) { const fieldKey = /** @type {RecordMapping} */ (field); let infos = _fieldKeyInfoCache.get(fieldKey); if (infos !== undefined) return infos; const keys = Object.getOwnPropertyNames(field); infos = Array.from({ length: keys.length }); for (let i = 0; i < keys.length; i++) { const key = keys[i]; const patternIndex = key.indexOf("*"); // `isValidPattern` is true when the key has at most one `*`. Searching // from `patternIndex + 1` stops as soon as a second `*` is found, so // we avoid the full-string scan that `lastIndexOf` would do — and the // single-star common case finishes in one pass. const isValidPattern = patternIndex === -1 || !key.includes("*", patternIndex + 1); const keyLen = key.length; const endsWithSlash = keyLen > 0 && key.charCodeAt(keyLen - 1) === slashCode; infos[i] = { key, patternIndex, wildcardPrefix: patternIndex === -1 ? "" : key.slice(0, patternIndex), wildcardSuffix: patternIndex === -1 ? "" : key.slice(patternIndex + 1), isLegacySubpath: patternIndex === -1 && endsWithSlash, isPattern: patternIndex !== -1, isSubpathMapping: endsWithSlash, isValidPattern, }; } _fieldKeyInfoCache.set(fieldKey, infos); return infos; } /** * @param {string} a first string * @param {string} b second string * @returns {number} compare result */ function patternKeyCompare(a, b) { const aPatternIndex = a.indexOf("*"); const bPatternIndex = b.indexOf("*"); const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1; const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1; if (baseLenA > baseLenB) return -1; if (baseLenB > baseLenA) return 1; if (aPatternIndex === -1) return 1; if (bPatternIndex === -1) return -1; if (a.length > b.length) return -1; if (b.length > a.length) return 1; return 0; } /** @typedef {[MappingValue, string, boolean, boolean, string] | null} MatchTuple */ /** * Per-field memoization of `findMatch(request, field)`. For a given field * the result depends only on the `request` string (it does NOT depend on * `conditionNames` — that's applied separately by `conditionalMapping`), * so we can cache the tuple keyed by request. * * Typical build traffic runs the same request through the resolver * repeatedly (same import re-resolved from different source files, module * graph traversals that revisit a package, etc.), and every one of those * hits walks the same key list and allocates the same tuple. Caching the * tuple turns the second-and-onward call into a single Map lookup. * * Keyed on the field object via a module-level `WeakMap`, so the cache * is freed automatically when the owning description file is GC'd. * @type {WeakMap>} */ const _findMatchCache = new WeakMap(); /** * @param {string} request request * @param {ExportsField | ImportsField} field exports or import field * @returns {MatchTuple} match result (uncached) */ function computeFindMatch(request, field) { const requestLen = request.length; const requestEndsWithSlash = requestLen > 0 && request.charCodeAt(requestLen - 1) === slashCode; const requestHasStar = request.includes("*"); if ( !requestHasStar && !requestEndsWithSlash && Object.prototype.hasOwnProperty.call(field, request) ) { const target = /** @type {{ [k: string]: MappingValue }} */ (field)[ request ]; return [target, "", false, false, request]; } /** @type {string} */ let bestMatch = ""; /** @type {FieldKeyInfo | null} */ let bestMatchInfo = null; /** @type {string | undefined} */ let bestMatchSubpath; const infos = getFieldKeyInfos(field); for (let i = 0; i < infos.length; i++) { const info = infos[i]; const { key, patternIndex } = info; if (patternIndex !== -1) { if ( !info.isValidPattern || !request.startsWith(info.wildcardPrefix) || requestLen < key.length || !request.endsWith(info.wildcardSuffix) || patternKeyCompare(bestMatch, key) !== 1 ) { continue; } bestMatch = key; bestMatchInfo = info; bestMatchSubpath = request.slice( patternIndex, requestLen - info.wildcardSuffix.length, ); } else if ( info.isLegacySubpath && request.startsWith(key) && patternKeyCompare(bestMatch, key) === 1 ) { bestMatch = key; bestMatchInfo = info; bestMatchSubpath = request.slice(key.length); } } if (bestMatch === "") return null; const target = /** @type {{ [k: string]: MappingValue }} */ (field)[bestMatch]; return [ target, /** @type {string} */ (bestMatchSubpath), /** @type {FieldKeyInfo} */ (bestMatchInfo).isSubpathMapping, /** @type {FieldKeyInfo} */ (bestMatchInfo).isPattern, bestMatch, ]; } /** * Trying to match request to field * @param {string} request request * @param {ExportsField | ImportsField} field exports or import field * @returns {MatchTuple} match or null, number is negative and one less when it's a folder mapping, number is request.length + 1 for direct mappings */ function findMatch(request, field) { const fieldKey = /** @type {RecordMapping} */ (field); let perRequest = _findMatchCache.get(fieldKey); if (perRequest === undefined) { perRequest = new Map(); _findMatchCache.set(fieldKey, perRequest); } else { // `computeFindMatch` only ever returns `MatchTuple | null` — never // `undefined` — and `Map.set(k, null)` then `Map.get(k)` returns // `null`, not `undefined`. So `get(...) === undefined` already // unambiguously means "not cached yet"; one Map lookup is enough, // no follow-up `has` needed to disambiguate "cached null". const cached = perRequest.get(request); if (cached !== undefined) return cached; } const result = computeFindMatch(request, field); perRequest.set(request, result); return result; } /** * Sentinel stored in the conditional-mapping cache for inputs whose walk * returns `null` ("no condition matched"). Using a non-null marker lets the * cache-hit path be a single `WeakMap.get()` — we distinguish * "cached null" from "not cached yet" without a second `has` call. */ const NULL_RESULT = Symbol("NULL_RESULT"); /** * Memoization of `conditionalMapping(mapping, conditionNames)`. The result * depends only on the mapping object (immutable — owned by a parsed * `package.json`) and the `conditionNames` Set (owned by the resolver's * options and stable for its lifetime), so it is safe to cache per (mapping, * conditionNames) pair. * * A conditional `exports` entry that appears inside a `directMapping` array * (the common `"browser": [...fallback list...]` shape, plus nested * conditions) gets walked on every resolve that traverses the parent entry. * Without this cache each of those walks re-reads `Object.keys` on the * mapping and re-visits every condition until one matches, even though the * inputs are identical. * * Outer key is the conditional mapping itself; inner key is the condition * Set. Both are object references, so WeakMap-of-WeakMap lets both levels * be collected automatically when the description file or resolver go away. * @type {WeakMap, DirectMapping | typeof NULL_RESULT>>} */ const _conditionalMappingCache = new WeakMap(); /** * @param {ConditionalMapping} conditionalMapping_ conditional mapping * @param {Set} conditionNames condition names * @returns {DirectMapping | null} direct mapping if found (uncached) */ function computeConditionalMapping(conditionalMapping_, conditionNames) { /** @type {[ConditionalMapping, string[], number][]} */ const lookup = [[conditionalMapping_, cachedKeys(conditionalMapping_), 0]]; loop: while (lookup.length > 0) { const top = lookup[lookup.length - 1]; const [mapping, conditions, j] = top; for (let i = j; i < conditions.length; i++) { const condition = conditions[i]; if (condition === "default" || conditionNames.has(condition)) { const innerMapping = mapping[condition]; if ( innerMapping !== null && typeof innerMapping === "object" && !Array.isArray(innerMapping) ) { const nested = /** @type {ConditionalMapping} */ (innerMapping); top[2] = i + 1; lookup.push([nested, cachedKeys(nested), 0]); continue loop; } return /** @type {DirectMapping} */ (innerMapping); } } lookup.pop(); } return null; } /** * @param {ConditionalMapping} conditionalMapping_ conditional mapping * @param {Set} conditionNames condition names * @returns {DirectMapping | null} direct mapping if found */ function conditionalMapping(conditionalMapping_, conditionNames) { let perSet = _conditionalMappingCache.get(conditionalMapping_); if (perSet !== undefined) { const cached = perSet.get(conditionNames); if (cached !== undefined) { return cached === NULL_RESULT ? null : /** @type {DirectMapping} */ (cached); } } else { perSet = new WeakMap(); _conditionalMappingCache.set(conditionalMapping_, perSet); } const result = computeConditionalMapping(conditionalMapping_, conditionNames); perSet.set(conditionNames, result === null ? NULL_RESULT : result); return result; } /** * @param {string | undefined} remainingRequest remaining request when folder mapping, undefined for file mappings * @param {boolean} isPattern true, if mapping is a pattern (contains "*") * @param {boolean} isSubpathMapping true, for subpath mappings * @param {string} mappingTarget direct export * @param {(d: string, f: boolean) => void} assert asserting direct value * @returns {string} mapping result */ function targetMapping( remainingRequest, isPattern, isSubpathMapping, mappingTarget, assert, ) { if (remainingRequest === undefined) { assert(mappingTarget, false); return mappingTarget; } if (isSubpathMapping) { assert(mappingTarget, true); return mappingTarget + remainingRequest; } assert(mappingTarget, false); let result = mappingTarget; if (isPattern) { const escapedRemainder = remainingRequest.includes("$") ? remainingRequest.replace(DOLLAR_ESCAPE_RE, "$$") : remainingRequest; result = result.replace(patternRegEx, escapedRemainder); } return result; } /** * @param {string | undefined} remainingRequest remaining request when folder mapping, undefined for file mappings * @param {boolean} isPattern true, if mapping is a pattern (contains "*") * @param {boolean} isSubpathMapping true, for subpath mappings * @param {DirectMapping | null} mappingTarget direct export * @param {Set} conditionNames condition names * @param {(d: string, f: boolean) => void} assert asserting direct value * @returns {string[]} mapping result */ function directMapping( remainingRequest, isPattern, isSubpathMapping, mappingTarget, conditionNames, assert, ) { if (mappingTarget === null) return []; if (typeof mappingTarget === "string") { return [ targetMapping( remainingRequest, isPattern, isSubpathMapping, mappingTarget, assert, ), ]; } /** @type {string[]} */ const targets = []; for (let i = 0, len = mappingTarget.length; i < len; i++) { const exp = mappingTarget[i]; if (typeof exp === "string") { targets.push( targetMapping( remainingRequest, isPattern, isSubpathMapping, exp, assert, ), ); continue; } const mapping = conditionalMapping(exp, conditionNames); if (!mapping) continue; const innerExports = directMapping( remainingRequest, isPattern, isSubpathMapping, mapping, conditionNames, assert, ); for (let j = 0, innerLen = innerExports.length; j < innerLen; j++) { targets.push(innerExports[j]); } } return targets; } /** @type {[string[], null]} */ const EMPTY_NO_MATCH = /** @type {[string[], null]} */ ([[], null]); /** * @param {ExportsField | ImportsField} field root * @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./` * @param {(s: string) => string} assertRequest assertRequest * @param {(s: string, f: boolean) => void} assertTarget assertTarget * @returns {FieldProcessor} field processor */ function createFieldProcessor( field, normalizeRequest, assertRequest, assertTarget, ) { return function fieldProcessor(request, conditionNames) { const match = findMatch(normalizeRequest(assertRequest(request)), field); if (match === null) return EMPTY_NO_MATCH; const [mapping, remainingRequest, isSubpathMapping, isPattern, usedField] = match; /** @type {DirectMapping | null} */ let direct; if ( mapping !== null && typeof mapping === "object" && !Array.isArray(mapping) ) { direct = conditionalMapping( /** @type {ConditionalMapping} */ (mapping), conditionNames, ); if (direct === null) return EMPTY_NO_MATCH; } else { direct = /** @type {DirectMapping} */ (mapping); } return [ directMapping( remainingRequest, isPattern, isSubpathMapping, direct, conditionNames, assertTarget, ), usedField, ]; }; } /** * @param {string} request request * @returns {string} updated request */ function assertExportsFieldRequest(request) { if (request.charCodeAt(0) !== dotCode) { throw new Error('Request should be relative path and start with "."'); } if (request.length === 1) return ""; if (request.charCodeAt(1) !== slashCode) { throw new Error('Request should be relative path and start with "./"'); } if (request.charCodeAt(request.length - 1) === slashCode) { throw new Error("Only requesting file allowed"); } return request.slice(2); } /** * @param {ExportsField} field exports field * @returns {ExportsField} normalized exports field */ function buildExportsField(field) { // handle syntax sugar, if exports field is direct mapping for "." if (typeof field === "string" || Array.isArray(field)) { return { ".": field }; } const keys = Object.keys(field); for (let i = 0; i < keys.length; i++) { const key = keys[i]; if (key.charCodeAt(0) !== dotCode) { // handle syntax sugar, if exports field is conditional mapping for "." if (i === 0) { while (i < keys.length) { const charCode = keys[i].charCodeAt(0); if (charCode === dotCode || charCode === slashCode) { throw new Error( `Exports field key should be relative path and start with "." (key: ${JSON.stringify( key, )})`, ); } i++; } return { ".": field }; } throw new Error( `Exports field key should be relative path and start with "." (key: ${JSON.stringify( key, )})`, ); } if (key.length === 1) { continue; } if (key.charCodeAt(1) !== slashCode) { throw new Error( `Exports field key should be relative path and start with "./" (key: ${JSON.stringify( key, )})`, ); } } return field; } /** * @param {string} exp export target * @param {boolean} expectFolder is folder expected */ function assertExportTarget(exp, expectFolder) { const parsedIdentifier = parseIdentifier(exp); if (!parsedIdentifier) { return; } const [relativePath] = parsedIdentifier; const isFolder = relativePath.charCodeAt(relativePath.length - 1) === slashCode; if (isFolder !== expectFolder) { throw new Error( expectFolder ? `Expecting folder to folder mapping. ${JSON.stringify( exp, )} should end with "/"` : `Expecting file to file mapping. ${JSON.stringify( exp, )} should not end with "/"`, ); } } /** * @param {ExportsField} exportsField the exports field * @returns {FieldProcessor} process callback */ module.exports.processExportsField = function processExportsField( exportsField, ) { return createFieldProcessor( buildExportsField(exportsField), (request) => (request.length === 0 ? "." : `./${request}`), assertExportsFieldRequest, assertExportTarget, ); }; /** * @param {string} request request * @returns {string} updated request */ function assertImportsFieldRequest(request) { if (request.charCodeAt(0) !== hashCode) { throw new Error('Request should start with "#"'); } if (request.length === 1) { throw new Error("Request should have at least 2 characters"); } // Note: #/ patterns are now allowed per Node.js PR #60864 // https://github.com/nodejs/node/pull/60864 if (request.charCodeAt(request.length - 1) === slashCode) { throw new Error("Only requesting file allowed"); } return request.slice(1); } /** * @param {string} imp import target * @param {boolean} expectFolder is folder expected */ function assertImportTarget(imp, expectFolder) { const parsedIdentifier = parseIdentifier(imp); if (!parsedIdentifier) { return; } const [relativePath] = parsedIdentifier; const isFolder = relativePath.charCodeAt(relativePath.length - 1) === slashCode; if (isFolder !== expectFolder) { throw new Error( expectFolder ? `Expecting folder to folder mapping. ${JSON.stringify( imp, )} should end with "/"` : `Expecting file to file mapping. ${JSON.stringify( imp, )} should not end with "/"`, ); } } /** * @param {ImportsField} importsField the exports field * @returns {FieldProcessor} process callback */ module.exports.processImportsField = function processImportsField( importsField, ) { return createFieldProcessor( importsField, (request) => `#${request}`, assertImportsFieldRequest, assertImportTarget, ); }; webpack-enhanced-resolve-7dfc9bc/lib/util/fileURLToPath.js000066400000000000000000000055561523262174200236530ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php */ "use strict"; // A runtime-agnostic port of Node's `url.fileURLToPath`, built on the global // `URL` (available in Node, browsers, Deno and Bun) so the resolver does not // depend on the Node `url` builtin. The platform branch can be forced via the // `windows` option; otherwise it follows the host platform like Node does. const CHAR_LOWERCASE_A = 97; const CHAR_LOWERCASE_Z = 122; const isWindows = typeof process !== "undefined" && process.platform === "win32"; const forwardSlashRegEx = /\//g; /** * @param {URL} url file: URL instance * @returns {string} Windows filesystem path */ function getPathFromURLWin32(url) { const { hostname } = url; let { pathname } = url; for (let n = 0; n < pathname.length; n++) { if (pathname[n] === "%") { const third = (pathname.codePointAt(n + 2) || 0) | 0x20; if ( (pathname[n + 1] === "2" && third === 102) || // 2f 2F (/) (pathname[n + 1] === "5" && third === 99) // 5c 5C (\) ) { throw new TypeError( "File URL path must not include encoded \\ or / characters", ); } } } pathname = pathname.replace(forwardSlashRegEx, "\\"); pathname = decodeURIComponent(pathname); if (hostname !== "") { // UNC path: `\\host\share\…`. Node runs the host through // `domainToUnicode`; we keep the (already punycode) hostname as-is, // which is identical for ASCII hosts and only differs for rare IDN UNC. return `\\\\${hostname}${pathname}`; } const letter = (pathname.codePointAt(1) || 0) | 0x20; const sep = pathname.charAt(2); if (letter < CHAR_LOWERCASE_A || letter > CHAR_LOWERCASE_Z || sep !== ":") { throw new TypeError("File URL path must be absolute"); } return pathname.slice(1); } /** * @param {URL} url file: URL instance * @returns {string} POSIX filesystem path */ function getPathFromURLPosix(url) { if (url.hostname !== "") { throw new TypeError('File URL host must be "localhost" or empty'); } const { pathname } = url; for (let n = 0; n < pathname.length; n++) { if (pathname[n] === "%") { const third = (pathname.codePointAt(n + 2) || 0) | 0x20; if (pathname[n + 1] === "2" && third === 102) { throw new TypeError( "File URL path must not include encoded / characters", ); } } } return decodeURIComponent(pathname); } /** * @param {string | URL} path a `file:` URL string or `URL` instance * @param {{ windows?: boolean }=} options force the platform branch * @returns {string} the filesystem path */ function fileURLToPath(path, options) { const url = typeof path === "string" ? new URL(path) : path; if (url.protocol !== "file:") { throw new TypeError("The URL must be of scheme file"); } const windows = options && options.windows !== undefined ? options.windows : isWindows; return windows ? getPathFromURLWin32(url) : getPathFromURLPosix(url); } module.exports = fileURLToPath; webpack-enhanced-resolve-7dfc9bc/lib/util/fs.js000066400000000000000000000071161523262174200216330ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Natsu @xiaoxiaojx */ "use strict"; const memoize = require("./memoize"); const stripJsonComments = require("./strip-json-comments"); /** @typedef {import("../Resolver").FileSystem} FileSystem */ /** @typedef {import("../Resolver").JsonObject} JsonObject */ /** * @typedef {object} ReadJsonOptions * @property {boolean=} stripComments Whether to strip JSONC comments */ /** @type {WeakMap} */ const _stripCommentsCache = new WeakMap(); // Only constructed for non-Buffer input: on Node the `Buffer.isBuffer` branch // in `decodeText` handles decoding, so the global `TextDecoder` (Node 11+, // always present in browsers/Deno/Bun) is only reached off the Buffer path. // `ignoreBOM: true` keeps a leading BOM in the output, matching // `Buffer.toString("utf8")` so both decode paths behave identically. // eslint-disable-next-line n/no-unsupported-features/node-builtins const getDecoder = memoize(() => new TextDecoder("utf-8", { ignoreBOM: true })); /** * Decode a file's raw contents to text without assuming a Node runtime. A * `Buffer` (Node) uses its fast native `toString`; any other binary input * (`Uint8Array` from a browser/Deno/Bun file system) goes through * `TextDecoder`, and strings are returned as-is. * @param {string | Buffer | Uint8Array} data raw file contents * @returns {string} decoded text */ const decodeText = (data) => { if (typeof data === "string") return data; if (typeof Buffer !== "undefined" && Buffer.isBuffer(data)) { return data.toString("utf8"); } return getDecoder().decode(data); }; /** * Read and parse JSON file (supports JSONC with comments). * Callback-based so a synchronous `fileSystem` stays synchronous all the * way through — Promise wrapping would defer resolution by a Promise tick * and break `resolveSync` when `tsconfig` is used together with * `useSyncFileSystemCalls: true`. * @param {FileSystem} fileSystem the file system * @param {string} jsonFilePath absolute path to JSON file * @param {ReadJsonOptions} options Options * @param {(err: NodeJS.ErrnoException | Error | null, content?: JsonObject) => void} callback callback * @returns {void} */ function readJson(fileSystem, jsonFilePath, options, callback) { const { stripComments = false } = options; const { readJson: fsReadJson } = fileSystem; if (fsReadJson && !stripComments) { fsReadJson(jsonFilePath, (err, content) => { if (err) return callback(err); callback(null, /** @type {JsonObject} */ (content)); }); return; } fileSystem.readFile(jsonFilePath, (err, data) => { if (err) return callback(err); const buf = /** @type {Buffer | Uint8Array | string} */ (data); // The strip-comments cache is keyed by the file-contents object; a file // system may hand back a plain string, which cannot be a WeakMap key, so // only cache when the contents are an object. const cacheable = stripComments && typeof buf === "object"; if (cacheable) { const cached = _stripCommentsCache.get(buf); if (cached !== undefined) return callback(null, cached); } let result; try { const jsonText = decodeText(buf); const jsonWithoutComments = stripComments ? stripJsonComments(jsonText, { trailingCommas: true, whitespace: true, }) : jsonText; result = JSON.parse(jsonWithoutComments); } catch (parseErr) { return callback(/** @type {Error} */ (parseErr)); } if (cacheable) { _stripCommentsCache.set(buf, result); } callback(null, result); }); } module.exports.decodeText = decodeText; module.exports.readJson = readJson; webpack-enhanced-resolve-7dfc9bc/lib/util/graceful-fs-browser.js000066400000000000000000000023541523262174200251010ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php */ "use strict"; // Browser stub for the default `graceful-fs` file system. A browser has no // ambient file system, so the convenience entry's default resolver has nothing // to read — pass your own `fileSystem` to `create()` / // `ResolverFactory.createResolver()` instead. Each method throws a clear error // if the default is actually used, while keeping the package able to bundle for // the browser (no Node `fs` dependency is pulled in). const message = "enhanced-resolve: no default file system is available in the browser. " + "Pass a `fileSystem` to `create()` or `ResolverFactory.createResolver()`."; /** * @returns {never} always throws */ const unavailable = () => { throw new Error(message); }; // The same set of methods `CachedInputFileSystem` reads from the file system // (graceful-fs has no `readJson`/`readJsonSync`, so those stay undefined). module.exports = { lstat: unavailable, lstatSync: unavailable, readFile: unavailable, readFileSync: unavailable, readdir: unavailable, readdirSync: unavailable, readlink: unavailable, readlinkSync: unavailable, realpath: unavailable, realpathSync: unavailable, stat: unavailable, statSync: unavailable, }; webpack-enhanced-resolve-7dfc9bc/lib/util/identifier.js000066400000000000000000000054501523262174200233440ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Ivan Kopeykin @vankop */ "use strict"; const { fileURLToPath } = require("url"); const PATH_QUERY_FRAGMENT_REGEXP = /^(#?(?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; const ZERO_ESCAPE_REGEXP = /\0(.)/g; const FILE_REG_EXP = /file:/i; /** * Index past a DOS device path prefix (`\\?\…` or `\\.\…`), or 0. Kept * out of `parseIdentifier` on purpose: inlining it back bloats the caller * beyond the size where V8's interpreter and JIT both handle it well * (the cause of the description-files-multi CodSpeed regression). * @param {string} identifier identifier known to start with `\` * @returns {number} 4 if identifier starts with a DOS device prefix, else 0 */ function dosPrefixEnd(identifier) { if ( identifier.length >= 4 && identifier.charCodeAt(1) === 92 && identifier.charCodeAt(3) === 92 ) { const c2 = identifier.charCodeAt(2); if (c2 === 63 || c2 === 46) return 4; } return 0; } /** * @param {string} identifier identifier * @returns {[string, string, string] | null} parsed identifier */ function parseIdentifier(identifier) { if (!identifier) { return null; } if (FILE_REG_EXP.test(identifier)) { identifier = fileURLToPath(identifier); } const firstEscape = identifier.indexOf("\0"); // Handle `\0` if (firstEscape !== -1) { const match = PATH_QUERY_FRAGMENT_REGEXP.exec(identifier); if (!match) return null; return [ match[1].replace(ZERO_ESCAPE_REGEXP, "$1"), match[2] ? match[2].replace(ZERO_ESCAPE_REGEXP, "$1") : "", match[3] || "", ]; } // Fast path for inputs that don't use \0 escaping. DOS device paths // (`\\?\…`, `\\.\…`) embed a literal `?` / `.` that must not be read // as a query separator; skip past the prefix when the input actually // starts with `\`. Gate is a single char-code compare so this function // stays inside V8's inline budget for its hot callers (resolver parse). const scanStart = identifier.charCodeAt(0) === 92 ? dosPrefixEnd(identifier) : 0; const queryStart = identifier.indexOf("?", scanStart); // Start at index 1 (or past a DOS prefix) to ignore a possible leading hash. const fragmentStart = identifier.indexOf("#", scanStart || 1); if (fragmentStart < 0) { if (queryStart < 0) { // No fragment, no query return [identifier, "", ""]; } // Query, no fragment return [identifier.slice(0, queryStart), identifier.slice(queryStart), ""]; } if (queryStart < 0 || fragmentStart < queryStart) { // Fragment, no query return [ identifier.slice(0, fragmentStart), "", identifier.slice(fragmentStart), ]; } // Query and fragment return [ identifier.slice(0, queryStart), identifier.slice(queryStart, fragmentStart), identifier.slice(fragmentStart), ]; } module.exports.parseIdentifier = parseIdentifier; webpack-enhanced-resolve-7dfc9bc/lib/util/memoize.js000066400000000000000000000013071523262174200226640ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; /** * @template T * @typedef {() => T} FunctionReturning */ /** * @template T * @param {FunctionReturning} fn memorized function * @returns {FunctionReturning} new function */ const memoize = (fn) => { let cache = false; /** @type {T | undefined} */ let result; return () => { if (cache) { return /** @type {T} */ (result); } result = fn(); cache = true; // Allow to clean up memory for fn // and all dependent resources /** @type {FunctionReturning | undefined} */ (fn) = undefined; return /** @type {T} */ (result); }; }; module.exports = memoize; webpack-enhanced-resolve-7dfc9bc/lib/util/module-browser.js000066400000000000000000000002111523262174200241560ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; module.exports = {}; webpack-enhanced-resolve-7dfc9bc/lib/util/path-browser.js000066400000000000000000000250451523262174200236410ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php */ "use strict"; // A browser shim for the Node `path` builtin, exposing only the subset used by // `lib/util/path.js`: `posix.normalize`, `posix.dirname`, `win32.normalize`, // `win32.dirname` and a (posix) `basename`. It is a faithful port of Node's // `path` implementation and is wired in through the package `browser` field, so // Node, Deno and Bun keep using their native `path` and only browser bundles // use this. Inputs are always strings here, so Node's `validateString` guards // are omitted. const CHAR_UPPERCASE_A = 65; const CHAR_UPPERCASE_Z = 90; const CHAR_LOWERCASE_A = 97; const CHAR_LOWERCASE_Z = 122; const CHAR_DOT = 46; const CHAR_FORWARD_SLASH = 47; const CHAR_BACKWARD_SLASH = 92; const CHAR_COLON = 58; /** * @param {number} code char code * @returns {boolean} true for `/` */ const isPosixPathSeparator = (code) => code === CHAR_FORWARD_SLASH; /** * @param {number} code char code * @returns {boolean} true for `/` or `\` */ const isPathSeparator = (code) => code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; /** * @param {number} code char code * @returns {boolean} true for an ASCII letter (a windows device root) */ const isWindowsDeviceRoot = (code) => (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) || (code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z); /** * Resolve `.` and `..` segments in a path. Ported from Node's internal * `normalizeString`. * @param {string} path path * @param {boolean} allowAboveRoot whether leading `..` may be kept * @param {string} separator path separator to emit * @param {(code: number) => boolean} isSeparator separator predicate * @returns {string} normalized path string (without root) */ function normalizeString(path, allowAboveRoot, separator, isSeparator) { let res = ""; let lastSegmentLength = 0; let lastSlash = -1; let dots = 0; let code = 0; for (let i = 0; i <= path.length; ++i) { if (i < path.length) { code = path.charCodeAt(i); } else if (isSeparator(code)) { break; } else { code = CHAR_FORWARD_SLASH; } if (isSeparator(code)) { if (lastSlash === i - 1 || dots === 1) { // NOOP } else if (dots === 2) { if ( res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT ) { if (res.length > 2) { const lastSlashIndex = res.lastIndexOf(separator); if (lastSlashIndex === -1) { res = ""; lastSegmentLength = 0; } else { res = res.slice(0, lastSlashIndex); lastSegmentLength = res.length - 1 - res.lastIndexOf(separator); } lastSlash = i; dots = 0; continue; } else if (res.length !== 0) { res = ""; lastSegmentLength = 0; lastSlash = i; dots = 0; continue; } } if (allowAboveRoot) { res += res.length > 0 ? `${separator}..` : ".."; lastSegmentLength = 2; } } else { if (res.length > 0) { res += `${separator}${path.slice(lastSlash + 1, i)}`; } else { res = path.slice(lastSlash + 1, i); } lastSegmentLength = i - lastSlash - 1; } lastSlash = i; dots = 0; } else if (code === CHAR_DOT && dots !== -1) { ++dots; } else { dots = -1; } } return res; } /** * @param {string} path path * @returns {string} normalized posix path */ function posixNormalize(path) { if (path.length === 0) return "."; const isAbsolute = path.charCodeAt(0) === CHAR_FORWARD_SLASH; const trailingSeparator = path.charCodeAt(path.length - 1) === CHAR_FORWARD_SLASH; path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator); if (path.length === 0) { if (isAbsolute) return "/"; return trailingSeparator ? "./" : "."; } if (trailingSeparator) path += "/"; return isAbsolute ? `/${path}` : path; } /** * @param {string} path path * @returns {string} posix dirname */ function posixDirname(path) { if (path.length === 0) return "."; const hasRoot = path.charCodeAt(0) === CHAR_FORWARD_SLASH; let end = -1; let matchedSlash = true; for (let i = path.length - 1; i >= 1; --i) { if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { if (!matchedSlash) { end = i; break; } } else { matchedSlash = false; } } if (end === -1) return hasRoot ? "/" : "."; if (hasRoot && end === 1) return "//"; return path.slice(0, end); } /** * Normalizes drive paths (`C:\…`), UNC paths (`\\server\share\…`), DOS device * paths (`\\.\…`, `\\?\…`) and relative/normal segments like Node's * `path.win32.normalize`, including the CVE-2024-36139 colon-segment guard. * * Scope note: reserved Windows device names (`CON`, `COM1`, `LPT1`, …) are not * special-cased, so e.g. `\\.\COM1:` differs from Node. Such names cannot occur * in a browser (the only place this shim is used) and the resolver never routes * them to `win32.normalize`, so this does not affect resolution. * @param {string} path path * @returns {string} normalized win32 path */ function win32Normalize(path) { const len = path.length; if (len === 0) return "."; let rootEnd = 0; /** @type {string | undefined} */ let device; let isAbsolute = false; const code = path.charCodeAt(0); if (len === 1) { return isPosixPathSeparator(code) ? "\\" : path; } if (isPathSeparator(code)) { // Possible UNC root; an initial separator means an absolute path. isAbsolute = true; if (isPathSeparator(path.charCodeAt(1))) { // Matched double path separator at beginning let j = 2; let last = j; while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; if (j < len && j !== last) { const firstPart = path.slice(last, j); last = j; while (j < len && isPathSeparator(path.charCodeAt(j))) j++; if (j < len && j !== last) { last = j; while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; if (j === len || j !== last) { if (firstPart === "." || firstPart === "?") { // Device root, e.g. `\\.\pipe\…` or `\\?\C:\…` device = `\\\\${firstPart}`; rootEnd = 4; } else if (j === len) { // Matched a UNC root only return `\\\\${firstPart}\\${path.slice(last)}\\`; } else { // Matched a UNC root with leftovers device = `\\\\${firstPart}\\${path.slice(last, j)}`; rootEnd = j; } } } } } else { rootEnd = 1; } } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { // Possible device root device = path.slice(0, 2); rootEnd = 2; if (len > 2 && isPathSeparator(path.charCodeAt(2))) { isAbsolute = true; rootEnd = 3; } } let tail = rootEnd < len ? normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator) : ""; if (tail.length === 0 && !isAbsolute) tail = "."; if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { tail += "\\"; } if (!isAbsolute && device === undefined && path.includes(":")) { // A relative path that wasn't resolved to a device must not turn into // something Windows could read as an absolute/drive path (CVE-2024-36139). if ( tail.length >= 2 && isWindowsDeviceRoot(tail.charCodeAt(0)) && tail.charCodeAt(1) === CHAR_COLON ) { return `.\\${tail}`; } let index = path.indexOf(":"); do { if (index === len - 1 || isPathSeparator(path.charCodeAt(index + 1))) { return `.\\${tail}`; } } while ((index = path.indexOf(":", index + 1)) !== -1); } if (device === undefined) { return isAbsolute ? `\\${tail}` : tail; } return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; } /** * @param {string} path path * @returns {string} win32 dirname */ function win32Dirname(path) { const len = path.length; if (len === 0) return "."; let rootEnd = -1; let offset = 0; const code = path.charCodeAt(0); if (len === 1) { return isPathSeparator(code) ? path : "."; } if (isPathSeparator(code)) { // Possible UNC root rootEnd = offset = 1; if (isPathSeparator(path.charCodeAt(1))) { let j = 2; let last = j; while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; if (j < len && j !== last) { last = j; while (j < len && isPathSeparator(path.charCodeAt(j))) j++; if (j < len && j !== last) { last = j; while (j < len && !isPathSeparator(path.charCodeAt(j))) j++; if (j === len) { // Matched a UNC root only return path; } if (j !== last) { // Matched a UNC root with leftovers rootEnd = offset = j + 1; } } } } } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { rootEnd = len > 2 && isPathSeparator(path.charCodeAt(2)) ? 3 : 2; offset = rootEnd; } let end = -1; let matchedSlash = true; for (let i = len - 1; i >= offset; --i) { if (isPathSeparator(path.charCodeAt(i))) { if (!matchedSlash) { end = i; break; } } else { matchedSlash = false; } } if (end === -1) { if (rootEnd === -1) return "."; end = rootEnd; } return path.slice(0, end); } /** * Posix `basename` — the browser is treated as a posix platform, matching how * Node picks the posix variant for `path.basename` on non-Windows systems. * @param {string} path path * @param {string=} suffix optional suffix to strip * @returns {string} basename */ function basename(path, suffix) { let start = 0; let end = -1; let matchedSlash = true; if ( suffix !== undefined && suffix.length > 0 && suffix.length <= path.length ) { if (suffix === path) return ""; let extIdx = suffix.length - 1; let firstNonSlashEnd = -1; for (let i = path.length - 1; i >= 0; --i) { const code = path.charCodeAt(i); if (code === CHAR_FORWARD_SLASH) { if (!matchedSlash) { start = i + 1; break; } } else { if (firstNonSlashEnd === -1) { matchedSlash = false; firstNonSlashEnd = i + 1; } if (extIdx >= 0) { if (code === suffix.charCodeAt(extIdx)) { if (--extIdx === -1) { end = i; } } else { extIdx = -1; end = firstNonSlashEnd; } } } } if (start === end) { end = firstNonSlashEnd; } else if (end === -1) { end = path.length; } return path.slice(start, end); } for (let i = path.length - 1; i >= 0; --i) { if (path.charCodeAt(i) === CHAR_FORWARD_SLASH) { if (!matchedSlash) { start = i + 1; break; } } else if (end === -1) { matchedSlash = false; end = i + 1; } } if (end === -1) return ""; return path.slice(start, end); } module.exports = { basename, posix: { normalize: posixNormalize, dirname: posixDirname }, win32: { normalize: win32Normalize, dirname: win32Dirname }, }; webpack-enhanced-resolve-7dfc9bc/lib/util/path.js000066400000000000000000000351111523262174200221530ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const path = require("path"); const { fileURLToPath } = require("url"); const CHAR_HASH = "#".charCodeAt(0); const CHAR_SLASH = "/".charCodeAt(0); const CHAR_BACKSLASH = "\\".charCodeAt(0); const CHAR_A = "A".charCodeAt(0); const CHAR_Z = "Z".charCodeAt(0); const CHAR_LOWER_A = "a".charCodeAt(0); const CHAR_LOWER_Z = "z".charCodeAt(0); const CHAR_DOT = ".".charCodeAt(0); const CHAR_COLON = ":".charCodeAt(0); const posixNormalize = path.posix.normalize; const winNormalize = path.win32.normalize; /** * @enum {number} */ const PathType = Object.freeze({ Empty: 0, Normal: 1, Relative: 2, AbsoluteWin: 3, AbsolutePosix: 4, Internal: 5, }); const deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i; const invalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i; /** * @param {string} maybePath a path * @returns {PathType} type of path */ const getType = (maybePath) => { switch (maybePath.length) { case 0: return PathType.Empty; case 1: { const c0 = maybePath.charCodeAt(0); switch (c0) { case CHAR_DOT: return PathType.Relative; case CHAR_SLASH: return PathType.AbsolutePosix; case CHAR_HASH: return PathType.Internal; } return PathType.Normal; } case 2: { const c0 = maybePath.charCodeAt(0); switch (c0) { case CHAR_DOT: { const c1 = maybePath.charCodeAt(1); switch (c1) { case CHAR_DOT: case CHAR_SLASH: return PathType.Relative; } return PathType.Normal; } case CHAR_SLASH: return PathType.AbsolutePosix; case CHAR_HASH: return PathType.Internal; } const c1 = maybePath.charCodeAt(1); if ( c1 === CHAR_COLON && ((c0 >= CHAR_A && c0 <= CHAR_Z) || (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) ) { return PathType.AbsoluteWin; } if (c0 === CHAR_BACKSLASH && c1 === CHAR_BACKSLASH) { return PathType.AbsoluteWin; } return PathType.Normal; } } const c0 = maybePath.charCodeAt(0); switch (c0) { case CHAR_DOT: { const c1 = maybePath.charCodeAt(1); switch (c1) { case CHAR_SLASH: return PathType.Relative; case CHAR_DOT: { const c2 = maybePath.charCodeAt(2); if (c2 === CHAR_SLASH) return PathType.Relative; return PathType.Normal; } } return PathType.Normal; } case CHAR_SLASH: return PathType.AbsolutePosix; case CHAR_HASH: return PathType.Internal; } const c1 = maybePath.charCodeAt(1); if (c1 === CHAR_COLON) { const c2 = maybePath.charCodeAt(2); if ( (c2 === CHAR_BACKSLASH || c2 === CHAR_SLASH) && ((c0 >= CHAR_A && c0 <= CHAR_Z) || (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z)) ) { return PathType.AbsoluteWin; } } // Two leading backslashes root a UNC share (`\\server\share`) or a DOS // device path (`\\?\…`, `\\.\…`); `path.win32` reads either as absolute, // so both belong on `path.win32` and not on posix. if (c0 === CHAR_BACKSLASH && c1 === CHAR_BACKSLASH) { return PathType.AbsoluteWin; } return PathType.Normal; }; /** * @param {string} maybePath a path * @returns {string} the normalized path */ const normalize = (maybePath) => { switch (getType(maybePath)) { case PathType.Empty: return maybePath; case PathType.AbsoluteWin: return winNormalize(maybePath); case PathType.Relative: { const r = posixNormalize(maybePath); return getType(r) === PathType.Relative ? r : `./${r}`; } } return posixNormalize(maybePath); }; /** * @param {string} rootPath the root path * @param {string | undefined} request the request path * @returns {string} the joined path */ const join = (rootPath, request) => { if (!request) return normalize(rootPath); const requestType = getType(request); switch (requestType) { case PathType.AbsolutePosix: return posixNormalize(request); case PathType.AbsoluteWin: return winNormalize(request); } switch (getType(rootPath)) { case PathType.Normal: case PathType.Relative: case PathType.AbsolutePosix: return posixNormalize(`${rootPath}/${request}`); case PathType.AbsoluteWin: return winNormalize(`${rootPath}\\${request}`); } switch (requestType) { case PathType.Empty: return rootPath; case PathType.Relative: { const r = posixNormalize(rootPath); return getType(r) === PathType.Relative ? r : `./${r}`; } } return posixNormalize(rootPath); }; /** * @param {string} maybePath a path * @returns {string} the directory name */ const dirname = (maybePath) => { switch (getType(maybePath)) { case PathType.AbsoluteWin: return path.win32.dirname(maybePath); } return path.posix.dirname(maybePath); }; /** @typedef {{ fn: (rootPath: string, request: string) => string, cache: Map> }} CachedJoin */ /** * @returns {CachedJoin} cached join */ const createCachedJoin = () => { /** @type {CachedJoin["cache"]} */ const cache = new Map(); /** @type {CachedJoin["fn"]} */ const fn = (rootPath, request) => { /** @type {string | undefined} */ let cacheEntry; let inner = cache.get(rootPath); if (inner === undefined) { cache.set(rootPath, (inner = new Map())); } else { cacheEntry = inner.get(request); if (cacheEntry !== undefined) return cacheEntry; } cacheEntry = join(rootPath, request); inner.set(request, cacheEntry); return cacheEntry; }; return { fn, cache }; }; /** @typedef {{ fn: (maybePath: string) => string, cache: Map }} CachedDirname */ /** * @returns {CachedDirname} cached dirname */ const createCachedDirname = () => { /** @type {CachedDirname["cache"]} */ const cache = new Map(); /** @type {CachedDirname["fn"]} */ const fn = (maybePath) => { const cacheEntry = cache.get(maybePath); if (cacheEntry !== undefined) return cacheEntry; const result = dirname(maybePath); cache.set(maybePath, result); return result; }; return { fn, cache }; }; /** @typedef {{ fn: (maybePath: string, suffix?: string) => string, cache: Map> }} CachedBasename */ /** * @returns {CachedBasename} cached basename */ const createCachedBasename = () => { /** @type {CachedBasename["cache"]} */ const cache = new Map(); /** @type {CachedBasename["fn"]} */ const fn = (maybePath, suffix) => { /** @type {string | undefined} */ let cacheEntry; let inner = cache.get(maybePath); if (inner === undefined) { cache.set(maybePath, (inner = new Map())); } else { cacheEntry = inner.get(suffix); if (cacheEntry !== undefined) return cacheEntry; } cacheEntry = path.basename(maybePath, suffix); inner.set(suffix, cacheEntry); return cacheEntry; }; return { fn, cache }; }; /** * Whether `request` is a relative request — i.e. matches `^\.\.?(?:\/|$)`. * * This is called on every `doResolve` via `UnsafeCachePlugin` and * `getInnerRequest`, so the char-code form is meaningfully faster than the * equivalent regex test: no regex state machine, no string object churn. * @param {string} request request string * @returns {boolean} true if request is relative */ const isRelativeRequest = (request) => { const len = request.length; if (len === 0 || request.charCodeAt(0) !== CHAR_DOT) return false; if (len === 1) return true; // "." const c1 = request.charCodeAt(1); if (c1 === CHAR_SLASH) return true; // "./..." if (c1 !== CHAR_DOT) return false; // ".x..." if (len === 2) return true; // ".." return request.charCodeAt(2) === CHAR_SLASH; // "../..." }; /** * Whether this is a Windows path, in which `/` and `\` are interchangeable and * paths compare case-insensitively, as opposed to a posix path, in which `\` is * an ordinary filename character. Decided by the root — a drive letter or a * leading `\` — which is where `path.win32` and `path.posix` disagree about * `parse(maybePath).root`, and never by the host platform, since Windows paths * are resolved on posix hosts and in browsers too. A path starting with `//` * stays posix: `path.win32` reads it as a UNC root, but here it cannot be told * apart from a posix path, where `\` has to keep being a filename character. * @param {string} maybePath a path * @returns {boolean} true, when the path is a Windows path */ const isWindowsPath = (maybePath) => { const c0 = maybePath.charCodeAt(0); if (c0 === CHAR_BACKSLASH) return true; if (maybePath.charCodeAt(1) !== CHAR_COLON) return false; return ( (c0 >= CHAR_A && c0 <= CHAR_Z) || (c0 >= CHAR_LOWER_A && c0 <= CHAR_LOWER_Z) ); }; /** * @param {number} charCode a char code * @param {boolean} windowsPath whether `\` separates segments * @returns {boolean} true, when the char code separates path segments */ const isSeparator = (charCode, windowsPath) => charCode === CHAR_SLASH || (windowsPath && charCode === CHAR_BACKSLASH); /** * @param {string} parentPath parent directory path * @param {boolean} windowsPath whether `parentPath` is a Windows path * @returns {number} length of `parentPath` without its trailing separators */ const parentPathLength = (parentPath, windowsPath) => { let end = parentPath.length; while (end > 0 && isSeparator(parentPath.charCodeAt(end - 1), windowsPath)) { end--; } return end; }; /** * Cold path of `startsWithPath`: Node lowercases whole paths rather than single * characters, which only makes a difference outside of ASCII. * @param {string} parentPath parent directory path * @param {number} length number of characters to compare * @param {string} childPath child path to check * @returns {boolean} true, when both prefixes name the same Windows path */ const equalsWindowsPrefix = (parentPath, length, childPath) => childPath.slice(0, length).replace(/\//g, "\\").toLowerCase() === parentPath.slice(0, length).replace(/\//g, "\\").toLowerCase(); /** * @param {string} parentPath parent directory path * @param {number} length number of characters of `parentPath` to compare * @param {string} childPath child path to check * @param {boolean} windowsPath whether `parentPath` is a Windows path * @returns {boolean} true, when `childPath` starts with that prefix */ const startsWithPath = (parentPath, length, childPath, windowsPath) => { if (childPath.length < length) return false; // The common case is an exact prefix of a parent without trailing // separators, which `startsWith` answers natively and without a slice. For // a posix parent that is the whole answer, only a Windows one has more // spellings of the same path to try. if (length === parentPath.length) { if (childPath.startsWith(parentPath)) return true; if (!windowsPath) return false; } for (let i = 0; i < length; i++) { const childCharCode = childPath.charCodeAt(i); const parentCharCode = parentPath.charCodeAt(i); if (childCharCode === parentCharCode) continue; if (!windowsPath) return false; // Windows mixes `/` and `\` freely and compares case-insensitively. if (isSeparator(childCharCode, true) && isSeparator(parentCharCode, true)) { continue; } if (childCharCode > 127 || parentCharCode > 127) { return equalsWindowsPrefix(parentPath, length, childPath); } const childLower = childCharCode >= CHAR_A && childCharCode <= CHAR_Z ? childCharCode + 32 : childCharCode; const parentLower = parentCharCode >= CHAR_A && parentCharCode <= CHAR_Z ? parentCharCode + 32 : parentCharCode; if (childLower !== parentLower) return false; } return true; }; /** * Whether childPath is parentPath itself or a path under it, the answer node's * `relative(parentPath, childPath)` gives: not escaping upward and not * absolute. A trailing separator on the parent is not part of the boundary, so * `/a/b/` contains exactly what `/a/b` contains. * @param {string} parentPath parent directory path * @param {string} childPath child path to check * @returns {boolean} true if childPath is parentPath or is under it */ const isInside = (parentPath, childPath) => { const windowsPath = isWindowsPath(parentPath); const length = parentPathLength(parentPath, windowsPath); if (!startsWithPath(parentPath, length, childPath, windowsPath)) return false; // The parent itself, or a segment boundary right after it so that `/a/b` // does not contain the sibling `/a/b-other`. return ( childPath.length === length || isSeparator(childPath.charCodeAt(length), windowsPath) ); }; /** * Check if childPath is a subdirectory of parentPath. Compares like `isInside`, * except that a path is not a subpath of itself. * * Called from `TsconfigPathsPlugin._selectPathsDataForContext` inside a loop * over every tsconfig-paths context on every resolve, so it's worth keeping * cheap: a native `startsWith` plus a separator char check answers it, and the * character loop only runs for a Windows path that the prefix test missed. * @param {string} parentPath parent directory path * @param {string} childPath child path to check * @returns {boolean} true if childPath is under parentPath */ const isSubPath = (parentPath, childPath) => { const windowsPath = isWindowsPath(parentPath); const length = parentPathLength(parentPath, windowsPath); if (childPath.length <= length) return false; if (!startsWithPath(parentPath, length, childPath, windowsPath)) return false; return isSeparator(childPath.charCodeAt(length), windowsPath); }; /** * Convert a `file:` `URL` instance to a filesystem path; any other input * (including plain strings) is returned unchanged. Mirrors Node's `fs`, which * treats strings as literal paths and only `URL` objects as URLs (see * nodejs/node#17658) — so a directory literally named `file:` is never * mistaken for a URL. * @param {string | URL} maybeURL a path string or a `file:` `URL` instance * @returns {string} a filesystem path */ const toPath = (maybeURL) => maybeURL instanceof URL ? fileURLToPath(maybeURL) : maybeURL; module.exports.PathType = PathType; module.exports.createCachedBasename = createCachedBasename; module.exports.createCachedDirname = createCachedDirname; module.exports.createCachedJoin = createCachedJoin; module.exports.deprecatedInvalidSegmentRegEx = deprecatedInvalidSegmentRegEx; module.exports.dirname = dirname; module.exports.getType = getType; module.exports.invalidSegmentRegEx = invalidSegmentRegEx; module.exports.isInside = isInside; module.exports.isRelativeRequest = isRelativeRequest; module.exports.isSubPath = isSubPath; module.exports.isWindowsPath = isWindowsPath; module.exports.join = join; module.exports.normalize = normalize; module.exports.toPath = toPath; webpack-enhanced-resolve-7dfc9bc/lib/util/process-browser.js000066400000000000000000000010171523262174200243540ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; module.exports = { /** * @type {Record} */ versions: {}, // eslint-disable-next-line jsdoc/reject-function-type /** @param {Function} fn function */ nextTick(fn) { // eslint-disable-next-line prefer-rest-params const args = Array.prototype.slice.call(arguments, 1); Promise.resolve().then(() => { // eslint-disable-next-line prefer-spread fn.apply(null, args); }); }, }; webpack-enhanced-resolve-7dfc9bc/lib/util/strip-json-comments.js000066400000000000000000000117741523262174200251630ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php Author Natsu @xiaoxiaojx This file contains code ported from strip-json-comments: https://github.com/sindresorhus/strip-json-comments Original license: MIT Original author: Sindre Sorhus */ "use strict"; /** * @typedef {object} StripJsonCommentsOptions * @property {boolean=} whitespace Replace comments with whitespace * @property {boolean=} trailingCommas Strip trailing commas */ const singleComment = Symbol("singleComment"); const multiComment = Symbol("multiComment"); /** * Strip without whitespace (returns empty string) * @param {string} _string Unused * @param {number} _start Unused * @param {number} _end Unused * @returns {string} Empty string for all input */ const stripWithoutWhitespace = (_string, _start, _end) => ""; /** * Replace all characters except ASCII spaces, tabs and line endings with regular spaces to ensure valid JSON output. * @param {string} string String to process * @param {number} start Start index * @param {number} end End index * @returns {string} Processed string with comments replaced by whitespace */ const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/[^ \t\r\n]/g, " "); /** * Check if a quote is escaped * @param {string} jsonString JSON string * @param {number} quotePosition Position of the quote * @returns {boolean} True if the quote at the given position is escaped */ const isEscaped = (jsonString, quotePosition) => { let index = quotePosition - 1; let backslashCount = 0; while (jsonString[index] === "\\") { index -= 1; backslashCount += 1; } return Boolean(backslashCount % 2); }; /** * Strip comments from JSON string * @param {string} jsonString JSON string with potential comments * @param {StripJsonCommentsOptions} options Options * @returns {string} JSON string without comments */ function stripJsonComments( jsonString, { whitespace = true, trailingCommas = false } = {}, ) { if (typeof jsonString !== "string") { throw new TypeError( `Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``, ); } const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace; let isInsideString = false; /** @type {false | typeof singleComment | typeof multiComment} */ let isInsideComment = false; let offset = 0; let buffer = ""; let result = ""; let commaIndex = -1; for (let index = 0; index < jsonString.length; index++) { const currentCharacter = jsonString[index]; const nextCharacter = jsonString[index + 1]; if (!isInsideComment && currentCharacter === '"') { // Enter or exit string const escaped = isEscaped(jsonString, index); if (!escaped) { isInsideString = !isInsideString; } } if (isInsideString) { continue; } if (!isInsideComment && currentCharacter + nextCharacter === "//") { // Enter single-line comment buffer += jsonString.slice(offset, index); offset = index; isInsideComment = singleComment; index++; } else if ( isInsideComment === singleComment && currentCharacter + nextCharacter === "\r\n" ) { // Exit single-line comment via \r\n index++; isInsideComment = false; buffer += strip(jsonString, offset, index); offset = index; continue; } else if (isInsideComment === singleComment && currentCharacter === "\n") { // Exit single-line comment via \n isInsideComment = false; buffer += strip(jsonString, offset, index); offset = index; } else if (!isInsideComment && currentCharacter + nextCharacter === "/*") { // Enter multiline comment buffer += jsonString.slice(offset, index); offset = index; isInsideComment = multiComment; index++; continue; } else if ( isInsideComment === multiComment && currentCharacter + nextCharacter === "*/" ) { // Exit multiline comment index++; isInsideComment = false; buffer += strip(jsonString, offset, index + 1); offset = index + 1; continue; } else if (trailingCommas && !isInsideComment) { if (commaIndex !== -1) { if (currentCharacter === "}" || currentCharacter === "]") { // Strip trailing comma buffer += jsonString.slice(offset, index); result += strip(buffer, 0, 1) + buffer.slice(1); buffer = ""; offset = index; commaIndex = -1; } else if ( currentCharacter !== " " && currentCharacter !== "\t" && currentCharacter !== "\r" && currentCharacter !== "\n" ) { // Hit non-whitespace following a comma; comma is not trailing buffer += jsonString.slice(offset, index); offset = index; commaIndex = -1; } } else if (currentCharacter === ",") { // Flush buffer prior to this point, and save new comma index result += buffer + jsonString.slice(offset, index); buffer = ""; offset = index; commaIndex = index; } } } const remaining = isInsideComment === singleComment ? strip(jsonString, offset, jsonString.length) : jsonString.slice(offset); return result + buffer + remaining; } module.exports = stripJsonComments; webpack-enhanced-resolve-7dfc9bc/lib/util/url-browser.js000066400000000000000000000007461523262174200235100ustar00rootroot00000000000000/* MIT License http://www.opensource.org/licenses/mit-license.php */ "use strict"; // Browser shim for the Node `url` builtin, providing the `fileURLToPath` the // resolver uses. Node, Deno and Bun use the native `url` (so they get the fully // correct implementation); only browser bundles use this, wired in through the // package `browser` field. The implementation is a URL-based port — see // ./fileURLToPath. module.exports = { fileURLToPath: require("./fileURLToPath"), }; webpack-enhanced-resolve-7dfc9bc/package-lock.json000066400000000000000000014002731523262174200223600ustar00rootroot00000000000000{ "name": "enhanced-resolve", "version": "5.24.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "enhanced-resolve", "version": "5.24.3", "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" }, "devDependencies": { "@changesets/cli": "^2.30.0", "@changesets/get-github-info": "^0.8.0", "@codspeed/core": "^5.2.0", "@types/graceful-fs": "^4.1.6", "@types/node": "^24.10.4", "cspell": "^10.0.0", "eslint": "^9.39.2", "eslint-config-webpack": "^4.9.5", "husky": "^9.1.7", "lint-staged": "^17.0.4", "memfs": "^4.56.11", "prettier": "^3.7.4", "tinybench": "^6.0.0", "tooling": "webpack/tooling#v1.26.4", "typescript": "^6.0.2", "webpack": "^5.107.2" }, "engines": { "node": ">=10.13.0" } }, "node_modules/@apidevtools/json-schema-ref-parser": { "version": "11.9.3", "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.9.3.tgz", "integrity": "sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ==", "dev": true, "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.15", "js-yaml": "^4.1.0" }, "engines": { "node": ">= 16" }, "funding": { "url": "https://github.com/sponsors/philsturgeon" } }, "node_modules/@babel/code-frame": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-module-transforms": "^7.29.7", "@babel/helpers": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/babel" } }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/generator": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/@babel/helper-globals": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dev": true, "license": "MIT", "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.7" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-string-parser": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dev": true, "license": "MIT", "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/parser": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.29.7" }, "bin": { "parser": "bin/babel-parser.js" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@babel/runtime": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/types": "^7.29.7", "debug": "^4.3.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/types": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@changesets/apply-release-plan": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.1.1.tgz", "integrity": "sha512-9qPCm/rLx/xoOFXIHGB229+4GOL76S4MC+7tyOuTsR6+1jYlfFDQORdvwR5hDA6y4FL2BPt3qpbcQIS+dW85LA==", "dev": true, "license": "MIT", "dependencies": { "@changesets/config": "^3.1.4", "@changesets/get-version-range-type": "^0.4.0", "@changesets/git": "^3.0.4", "@changesets/should-skip-package": "^0.1.2", "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "detect-indent": "^6.0.0", "fs-extra": "^7.0.1", "lodash.startcase": "^4.4.0", "outdent": "^0.5.0", "prettier": "^2.7.1", "resolve-from": "^5.0.0", "semver": "^7.5.3" } }, "node_modules/@changesets/apply-release-plan/node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "license": "MIT", "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/@changesets/assemble-release-plan": { "version": "6.0.10", "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.10.tgz", "integrity": "sha512-rSDcqdJ9KbVyjpBIuCidhvZNIiVt1XaIYp73ycVQRIA5n/j6wQaEk0ChRLMUQ1vkxZe51PTQ9OIhbg6HQMW45A==", "dev": true, "license": "MIT", "dependencies": { "@changesets/errors": "^0.2.0", "@changesets/get-dependents-graph": "^2.1.4", "@changesets/should-skip-package": "^0.1.2", "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "semver": "^7.5.3" } }, "node_modules/@changesets/changelog-git": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.1.tgz", "integrity": "sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==", "dev": true, "license": "MIT", "dependencies": { "@changesets/types": "^6.1.0" } }, "node_modules/@changesets/cli": { "version": "2.31.0", "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.31.0.tgz", "integrity": "sha512-AhI4enNTgHu2IZr6K4WZyf0EPch4XVMn1yOMFmCD9gsfBGqMYaHXls5HyDv6/CL5axVQABz68eG30eCtbr2wFg==", "dev": true, "license": "MIT", "dependencies": { "@changesets/apply-release-plan": "^7.1.1", "@changesets/assemble-release-plan": "^6.0.10", "@changesets/changelog-git": "^0.2.1", "@changesets/config": "^3.1.4", "@changesets/errors": "^0.2.0", "@changesets/get-dependents-graph": "^2.1.4", "@changesets/get-release-plan": "^4.0.16", "@changesets/git": "^3.0.4", "@changesets/logger": "^0.1.1", "@changesets/pre": "^2.0.2", "@changesets/read": "^0.6.7", "@changesets/should-skip-package": "^0.1.2", "@changesets/types": "^6.1.0", "@changesets/write": "^0.4.0", "@inquirer/external-editor": "^1.0.2", "@manypkg/get-packages": "^1.1.3", "ansi-colors": "^4.1.3", "enquirer": "^2.4.1", "fs-extra": "^7.0.1", "mri": "^1.2.0", "package-manager-detector": "^0.2.0", "picocolors": "^1.1.0", "resolve-from": "^5.0.0", "semver": "^7.5.3", "spawndamnit": "^3.0.1", "term-size": "^2.1.0" }, "bin": { "changeset": "bin.js" } }, "node_modules/@changesets/config": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@changesets/config/-/config-3.1.4.tgz", "integrity": "sha512-pf0bvD/v6WI2cRlZ6hzpjtZdSlXDXMAJ+Iz7xfFzV4ZxJ8OGGAON+1qYc99ZPrijnt4xp3VGG7eNvAOGS24V1Q==", "dev": true, "license": "MIT", "dependencies": { "@changesets/errors": "^0.2.0", "@changesets/get-dependents-graph": "^2.1.4", "@changesets/logger": "^0.1.1", "@changesets/should-skip-package": "^0.1.2", "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1", "micromatch": "^4.0.8" } }, "node_modules/@changesets/errors": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", "dev": true, "license": "MIT", "dependencies": { "extendable-error": "^0.1.5" } }, "node_modules/@changesets/get-dependents-graph": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-2.1.4.tgz", "integrity": "sha512-ZsS00x6WvmHq3sQv8oCMwL0f/z3wbXCVuSVTJwCnnmbC/iBdNJGFx1EcbMG4PC6sXRyH69liM4A2WKXzn/kRPg==", "dev": true, "license": "MIT", "dependencies": { "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "picocolors": "^1.1.0", "semver": "^7.5.3" } }, "node_modules/@changesets/get-github-info": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.8.0.tgz", "integrity": "sha512-cRnC+xdF0JIik7coko3iUP9qbnfi1iJQ3sAa6dE+Tx3+ET8bjFEm63PA4WEohgjYcmsOikPHWzPsMWWiZmntOQ==", "dev": true, "license": "MIT", "dependencies": { "dataloader": "^1.4.0", "node-fetch": "^2.5.0" } }, "node_modules/@changesets/get-release-plan": { "version": "4.0.16", "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-4.0.16.tgz", "integrity": "sha512-2K5Om6CrMPm45rtvckfzWo7e9jOVCKLCnXia5eUPaURH7/LWzri7pK1TycdzAuAtehLkW7VPbWLCSExTHmiI6g==", "dev": true, "license": "MIT", "dependencies": { "@changesets/assemble-release-plan": "^6.0.10", "@changesets/config": "^3.1.4", "@changesets/pre": "^2.0.2", "@changesets/read": "^0.6.7", "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3" } }, "node_modules/@changesets/get-version-range-type": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz", "integrity": "sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==", "dev": true, "license": "MIT" }, "node_modules/@changesets/git": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@changesets/git/-/git-3.0.4.tgz", "integrity": "sha512-BXANzRFkX+XcC1q/d27NKvlJ1yf7PSAgi8JG6dt8EfbHFHi4neau7mufcSca5zRhwOL8j9s6EqsxmT+s+/E6Sw==", "dev": true, "license": "MIT", "dependencies": { "@changesets/errors": "^0.2.0", "@manypkg/get-packages": "^1.1.3", "is-subdir": "^1.1.1", "micromatch": "^4.0.8", "spawndamnit": "^3.0.1" } }, "node_modules/@changesets/logger": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.1.1.tgz", "integrity": "sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==", "dev": true, "license": "MIT", "dependencies": { "picocolors": "^1.1.0" } }, "node_modules/@changesets/parse": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.4.3.tgz", "integrity": "sha512-ZDmNc53+dXdWEv7fqIUSgRQOLYoUom5Z40gmLgmATmYR9NbL6FJJHwakcCpzaeCy+1D0m0n7mT4jj2B/MQPl7A==", "dev": true, "license": "MIT", "dependencies": { "@changesets/types": "^6.1.0", "js-yaml": "^4.1.1" } }, "node_modules/@changesets/pre": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.2.tgz", "integrity": "sha512-HaL/gEyFVvkf9KFg6484wR9s0qjAXlZ8qWPDkTyKF6+zqjBe/I2mygg3MbpZ++hdi0ToqNUF8cjj7fBy0dg8Ug==", "dev": true, "license": "MIT", "dependencies": { "@changesets/errors": "^0.2.0", "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1" } }, "node_modules/@changesets/read": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.7.tgz", "integrity": "sha512-D1G4AUYGrBEk8vj8MGwf75k9GpN6XL3wg8i42P2jZZwFLXnlr2Pn7r9yuQNbaMCarP7ZQWNJbV6XLeysAIMhTA==", "dev": true, "license": "MIT", "dependencies": { "@changesets/git": "^3.0.4", "@changesets/logger": "^0.1.1", "@changesets/parse": "^0.4.3", "@changesets/types": "^6.1.0", "fs-extra": "^7.0.1", "p-filter": "^2.1.0", "picocolors": "^1.1.0" } }, "node_modules/@changesets/should-skip-package": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@changesets/should-skip-package/-/should-skip-package-0.1.2.tgz", "integrity": "sha512-qAK/WrqWLNCP22UDdBTMPH5f41elVDlsNyat180A33dWxuUDyNpg6fPi/FyTZwRriVjg0L8gnjJn2F9XAoF0qw==", "dev": true, "license": "MIT", "dependencies": { "@changesets/types": "^6.1.0", "@manypkg/get-packages": "^1.1.3" } }, "node_modules/@changesets/types": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.1.0.tgz", "integrity": "sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==", "dev": true, "license": "MIT" }, "node_modules/@changesets/write": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.4.0.tgz", "integrity": "sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==", "dev": true, "license": "MIT", "dependencies": { "@changesets/types": "^6.1.0", "fs-extra": "^7.0.1", "human-id": "^4.1.1", "prettier": "^2.7.1" } }, "node_modules/@changesets/write/node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "license": "MIT", "bin": { "prettier": "bin-prettier.js" }, "engines": { "node": ">=10.13.0" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/@codspeed/core": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@codspeed/core/-/core-5.6.0.tgz", "integrity": "sha512-m9e5hGD2z7oWme78AvyNVq9kKkh7NjBgUImiIEE55hlEk363AmOinxIQPc7vKeNgwOBflUcXOMTqQRLjwHcfUA==", "dev": true, "license": "Apache-2.0", "dependencies": { "axios": "^1.4.0", "find-up": "^6.3.0", "form-data": "^4.0.4", "node-gyp-build": "^4.6.0", "stack-trace": "1.0.0-pre2" } }, "node_modules/@cspell/cspell-bundled-dicts": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-10.0.1.tgz", "integrity": "sha512-WvkSDNX4Uyyj/ZgbPO6L38iFNMfK1EqsH1FteRiI2qLz6QZMXRFrIt12OqiWIplzZDDaVpBH9FCJOPJll0fjCQ==", "dev": true, "license": "MIT", "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", "@cspell/dict-aws": "^4.0.17", "@cspell/dict-bash": "^4.2.2", "@cspell/dict-companies": "^3.2.11", "@cspell/dict-cpp": "^7.0.2", "@cspell/dict-cryptocurrencies": "^5.0.5", "@cspell/dict-csharp": "^4.0.8", "@cspell/dict-css": "^4.1.1", "@cspell/dict-dart": "^2.3.2", "@cspell/dict-data-science": "^2.0.13", "@cspell/dict-django": "^4.1.6", "@cspell/dict-docker": "^1.1.17", "@cspell/dict-dotnet": "^5.0.13", "@cspell/dict-elixir": "^4.0.8", "@cspell/dict-en_us": "^4.4.33", "@cspell/dict-en-common-misspellings": "^2.1.12", "@cspell/dict-en-gb-mit": "^3.1.22", "@cspell/dict-filetypes": "^3.0.18", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.6", "@cspell/dict-fsharp": "^1.1.1", "@cspell/dict-fullstack": "^3.2.9", "@cspell/dict-gaming-terms": "^1.1.2", "@cspell/dict-git": "^3.1.0", "@cspell/dict-golang": "^6.0.26", "@cspell/dict-google": "^1.0.9", "@cspell/dict-haskell": "^4.0.6", "@cspell/dict-html": "^4.0.15", "@cspell/dict-html-symbol-entities": "^4.0.5", "@cspell/dict-java": "^5.0.12", "@cspell/dict-julia": "^1.1.1", "@cspell/dict-k8s": "^1.0.12", "@cspell/dict-kotlin": "^1.1.1", "@cspell/dict-latex": "^5.1.0", "@cspell/dict-lorem-ipsum": "^4.0.5", "@cspell/dict-lua": "^4.0.8", "@cspell/dict-makefile": "^1.0.5", "@cspell/dict-markdown": "^2.0.16", "@cspell/dict-monkeyc": "^1.0.12", "@cspell/dict-node": "^5.0.9", "@cspell/dict-npm": "^5.2.38", "@cspell/dict-php": "^4.1.1", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.16", "@cspell/dict-python": "^4.2.26", "@cspell/dict-r": "^2.1.1", "@cspell/dict-ruby": "^5.1.1", "@cspell/dict-rust": "^4.1.2", "@cspell/dict-scala": "^5.0.9", "@cspell/dict-shell": "^1.1.2", "@cspell/dict-software-terms": "^5.2.2", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", "@cspell/dict-terraform": "^1.1.3", "@cspell/dict-typescript": "^3.2.3", "@cspell/dict-vue": "^3.0.5", "@cspell/dict-zig": "^1.0.0" }, "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-json-reporter": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-10.0.1.tgz", "integrity": "sha512-/nes1RGILec3WCBcoMOd0byNTBtnJuPaVz/+ZzqYkLtY7x58VMcBG5kyP6hPyN8cIwjRADE/SR43gwdXuqk/FA==", "dev": true, "license": "MIT", "dependencies": { "@cspell/cspell-types": "10.0.1" }, "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-performance-monitor": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-performance-monitor/-/cspell-performance-monitor-10.0.1.tgz", "integrity": "sha512-9tVcHXwRnbazUv4WSG0h3MqV4+LgmLNgSALAQUflPPW0EMxTf7C4Dmv9cgxJyCEQrdnVKCr58nPPaahhz9LJUg==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-pipe": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-10.0.1.tgz", "integrity": "sha512-HPeXMD9AZ3V/qPkvQaPcak+C7cJ2z7JTHN8smd6J8L2aThLRky2cHc2OyeaHPSHB7WA47b4z2n5u5nawZhv5VQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-resolver": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-10.0.1.tgz", "integrity": "sha512-PIzkZHD1fGUQx1XteK2d1iQ0Mzq/maYcoB4jkvAiiR6WqP3MWYNKFdI9z+R5pOq5KgMfW+5Ig1q0oSR6h8irlA==", "dev": true, "license": "MIT", "dependencies": { "global-directory": "^5.0.0" }, "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-service-bus": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-10.0.1.tgz", "integrity": "sha512-y6NcIGP2IdXaBL4PVH8vxsr7K27wzz3Ech87UtUtrDSXAiVEOvXgAIknEOUVp59rTlUE8Rn4IRURC6f/hgMyfw==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-types": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-10.0.1.tgz", "integrity": "sha512-kLgLShnWADDVreKC63pBrWkcvxgZzFIfO34Jhx/SWfuOIA3cD8AXT+HjyuLfoGJ7mUb58hv2kUziKzEy4INb1w==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/cspell-worker": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/cspell-worker/-/cspell-worker-10.0.1.tgz", "integrity": "sha512-L2bJerfuYOls2wEknm8FmynLtj/G7O4UqX9I/HznRggEW6i2yZIxagDetpVDNowpyavNHJ3SJtUFiyMiZc16Sw==", "dev": true, "license": "MIT", "dependencies": { "cspell-lib": "10.0.1" }, "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/dict-ada": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-ada/-/dict-ada-4.1.1.tgz", "integrity": "sha512-E+0YW9RhZod/9Qy2gxfNZiHJjCYFlCdI69br1eviQQWB8yOTJX0JHXLs79kOYhSW0kINPVUdvddEBe6Lu6CjGQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-al": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-al/-/dict-al-1.1.1.tgz", "integrity": "sha512-sD8GCaZetgQL4+MaJLXqbzWcRjfKVp8x+px3HuCaaiATAAtvjwUQ5/Iubiqwfd1boIh2Y1/3EgM3TLQ7Q8e0wQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-aws": { "version": "4.0.17", "resolved": "https://registry.npmjs.org/@cspell/dict-aws/-/dict-aws-4.0.17.tgz", "integrity": "sha512-ORcblTWcdlGjIbWrgKF+8CNEBQiLVKdUOFoTn0KPNkAYnFcdPP0muT4892h7H4Xafh3j72wqB4/loQ6Nti9E/w==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-bash": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/@cspell/dict-bash/-/dict-bash-4.2.3.tgz", "integrity": "sha512-ljUZoKHbDqw5Sx0qpL2qTUlmkmr+vhZH/sCNrNaBZKTbdgiswErSnIF1jRbGmEitJNxHRHWsuZyVgnTGfVO1Yw==", "dev": true, "license": "MIT", "dependencies": { "@cspell/dict-shell": "1.2.0" } }, "node_modules/@cspell/dict-companies": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/@cspell/dict-companies/-/dict-companies-3.2.11.tgz", "integrity": "sha512-0cmafbcz2pTHXLd59eLR1gvDvN6aWAOM0+cIL4LLF9GX9yB2iKDNrKsvs4tJRqutoaTdwNFBbV0FYv+6iCtebQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-cpp": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/@cspell/dict-cpp/-/dict-cpp-7.0.2.tgz", "integrity": "sha512-dfbeERiVNeqmo/npivdR6rDiBCqZi3QtjH2Z0HFcXwpdj6i97dX1xaKyK2GUsO/p4u1TOv63Dmj5Vm48haDpuA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-cryptocurrencies": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-5.0.5.tgz", "integrity": "sha512-R68hYYF/rtlE6T/dsObStzN5QZw+0aQBinAXuWCVqwdS7YZo0X33vGMfChkHaiCo3Z2+bkegqHlqxZF4TD3rUA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-csharp": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/@cspell/dict-csharp/-/dict-csharp-4.0.8.tgz", "integrity": "sha512-qmk45pKFHSxckl5mSlbHxmDitSsGMlk/XzFgt7emeTJWLNSTUK//MbYAkBNRtfzB4uD7pAFiKgpKgtJrTMRnrQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-css": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.1.2.tgz", "integrity": "sha512-+ylGoKdwZ2sVOCOnU2Eq5wDZx+RaVX3HoKyNHGGsFvhSw6IidQ6tH/mAPKBDofViHJoWCPNlklE0lTr6MDG3QA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-dart": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/@cspell/dict-dart/-/dict-dart-2.3.2.tgz", "integrity": "sha512-sUiLW56t9gfZcu8iR/5EUg+KYyRD83Cjl3yjDEA2ApVuJvK1HhX+vn4e4k4YfjpUQMag8XO2AaRhARE09+/rqw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-data-science": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/@cspell/dict-data-science/-/dict-data-science-2.0.14.tgz", "integrity": "sha512-jl6Ds4u5u5JT+yY30pWQpAbdCHfy3lCcNkLbpL/AZKoUaLEoXbaYsps9xQtvD7DyaiXxiLZkdH2yHHXtoFtZyg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-django": { "version": "4.1.6", "resolved": "https://registry.npmjs.org/@cspell/dict-django/-/dict-django-4.1.6.tgz", "integrity": "sha512-SdbSFDGy9ulETqNz15oWv2+kpWLlk8DJYd573xhIkeRdcXOjskRuxjSZPKfW7O3NxN/KEf3gm3IevVOiNuFS+w==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-docker": { "version": "1.1.17", "resolved": "https://registry.npmjs.org/@cspell/dict-docker/-/dict-docker-1.1.17.tgz", "integrity": "sha512-OcnVTIpHIYYKhztNTyK8ShAnXTfnqs43hVH6p0py0wlcwRIXe5uj4f12n7zPf2CeBI7JAlPjEsV0Rlf4hbz/xQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-dotnet": { "version": "5.0.13", "resolved": "https://registry.npmjs.org/@cspell/dict-dotnet/-/dict-dotnet-5.0.13.tgz", "integrity": "sha512-xPp7jMnFpOri7tzmqmm/dXMolXz1t2bhNqxYkOyMqXhvs08oc7BFs+EsbDY0X7hqiISgeFZGNqn0dOCr+ncPYw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-elixir": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/@cspell/dict-elixir/-/dict-elixir-4.0.8.tgz", "integrity": "sha512-CyfphrbMyl4Ms55Vzuj+mNmd693HjBFr9hvU+B2YbFEZprE5AG+EXLYTMRWrXbpds4AuZcvN3deM2XVB80BN/Q==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-en_us": { "version": "4.4.35", "resolved": "https://registry.npmjs.org/@cspell/dict-en_us/-/dict-en_us-4.4.35.tgz", "integrity": "sha512-xWpxBCc/FzzMMo/A+0qwARVaIIhR0Ql8yhhv4rvsvg+GfQF+LG9yzg2GwTM5N2rjvzmM3nKuR9zxFZq2I6fJSg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-en-common-misspellings": { "version": "2.1.12", "resolved": "https://registry.npmjs.org/@cspell/dict-en-common-misspellings/-/dict-en-common-misspellings-2.1.12.tgz", "integrity": "sha512-14Eu6QGqyksqOd4fYPuRb58lK1Va7FQK9XxFsRKnZU8LhL3N+kj7YKDW+7aIaAN/0WGEqslGP6lGbQzNti8Akw==", "dev": true, "license": "CC BY-SA 4.0" }, "node_modules/@cspell/dict-en-gb-mit": { "version": "3.1.24", "resolved": "https://registry.npmjs.org/@cspell/dict-en-gb-mit/-/dict-en-gb-mit-3.1.24.tgz", "integrity": "sha512-Oowb/Uzkh7OmDRdCcETzMc9imEb4IpLlHJXoYjX8A8DS2X/54gqSjI915JFB8hKtFjBko5OM0BLQ+6cZhFEMmQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { "version": "3.0.18", "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.18.tgz", "integrity": "sha512-yU7RKD/x1IWmDLzWeiItMwgV+6bUcU/af23uS0+uGiFUbsY1qWV/D4rxlAAO6Z7no3J2z8aZOkYIOvUrJq0Rcw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-flutter": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-flutter/-/dict-flutter-1.1.1.tgz", "integrity": "sha512-UlOzRcH2tNbFhZmHJN48Za/2/MEdRHl2BMkCWZBYs+30b91mWvBfzaN4IJQU7dUZtowKayVIF9FzvLZtZokc5A==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-fonts": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-fonts/-/dict-fonts-4.0.6.tgz", "integrity": "sha512-aR/0csY01dNb0A1tw/UmN9rKgHruUxsYsvXu6YlSBJFu60s26SKr/k1o4LavpHTQ+lznlYMqAvuxGkE4Flliqw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-fsharp": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-fsharp/-/dict-fsharp-1.1.1.tgz", "integrity": "sha512-imhs0u87wEA4/cYjgzS0tAyaJpwG7vwtC8UyMFbwpmtw+/bgss+osNfyqhYRyS/ehVCWL17Ewx2UPkexjKyaBA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-fullstack": { "version": "3.2.9", "resolved": "https://registry.npmjs.org/@cspell/dict-fullstack/-/dict-fullstack-3.2.9.tgz", "integrity": "sha512-diZX+usW5aZ4/b2T0QM/H/Wl9aNMbdODa1Jq0ReBr/jazmNeWjd+PyqeVgzd1joEaHY+SAnjrf/i9CwKd2ZtWQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-gaming-terms": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@cspell/dict-gaming-terms/-/dict-gaming-terms-1.1.2.tgz", "integrity": "sha512-9XnOvaoTBscq0xuD6KTEIkk9hhdfBkkvJAIsvw3JMcnp1214OCGW8+kako5RqQ2vTZR3Tnf3pc57o7VgkM0q1Q==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-git": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-git/-/dict-git-3.1.0.tgz", "integrity": "sha512-KEt9zGkxqGy2q1nwH4CbyqTSv5nadpn8BAlDnzlRcnL0Xb3LX9xTgSGShKvzb0bw35lHoYyLWN2ZKAqbC4pgGQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-golang": { "version": "6.0.26", "resolved": "https://registry.npmjs.org/@cspell/dict-golang/-/dict-golang-6.0.26.tgz", "integrity": "sha512-YKA7Xm5KeOd14v5SQ4ll6afe9VSy3a2DWM7L9uBq4u3lXToRBQ1W5PRa+/Q9udd+DTURyVVnQ+7b9cnOlNxaRg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-google": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-google/-/dict-google-1.0.9.tgz", "integrity": "sha512-biL65POqialY0i4g6crj7pR6JnBkbsPovB2WDYkj3H4TuC/QXv7Pu5pdPxeUJA6TSCHI7T5twsO4VSVyRxD9CA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-haskell": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-haskell/-/dict-haskell-4.0.6.tgz", "integrity": "sha512-ib8SA5qgftExpYNjWhpYIgvDsZ/0wvKKxSP+kuSkkak520iPvTJumEpIE+qPcmJQo4NzdKMN8nEfaeci4OcFAQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-html": { "version": "4.0.15", "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.15.tgz", "integrity": "sha512-GJYnYKoD9fmo2OI0aySEGZOjThnx3upSUvV7mmqUu8oG+mGgzqm82P/f7OqsuvTaInZZwZbo+PwJQd/yHcyFIw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-html-symbol-entities": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.5.tgz", "integrity": "sha512-429alTD4cE0FIwpMucvSN35Ld87HCyuM8mF731KU5Rm4Je2SG6hmVx7nkBsLyrmH3sQukTcr1GaiZsiEg8svPA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-java": { "version": "5.0.12", "resolved": "https://registry.npmjs.org/@cspell/dict-java/-/dict-java-5.0.12.tgz", "integrity": "sha512-qPSNhTcl7LGJ5Qp6VN71H8zqvRQK04S08T67knMq9hTA8U7G1sTKzLmBaDOFhq17vNX/+rT+rbRYp+B5Nwza1A==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-julia": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-julia/-/dict-julia-1.1.1.tgz", "integrity": "sha512-WylJR9TQ2cgwd5BWEOfdO3zvDB+L7kYFm0I9u0s9jKHWQ6yKmfKeMjU9oXxTBxIufhCXm92SKwwVNAC7gjv+yA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-k8s": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/@cspell/dict-k8s/-/dict-k8s-1.0.12.tgz", "integrity": "sha512-2LcllTWgaTfYC7DmkMPOn9GsBWsA4DZdlun4po8s2ysTP7CPEnZc1ZfK6pZ2eI4TsZemlUQQ+NZxMe9/QutQxg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-kotlin": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-kotlin/-/dict-kotlin-1.1.1.tgz", "integrity": "sha512-J3NzzfgmxRvEeOe3qUXnSJQCd38i/dpF9/t3quuWh6gXM+krsAXP75dY1CzDmS8mrJAlBdVBeAW5eAZTD8g86Q==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-latex": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/@cspell/dict-latex/-/dict-latex-5.1.0.tgz", "integrity": "sha512-qxT4guhysyBt0gzoliXYEBYinkAdEtR2M7goRaUH0a7ltCsoqqAeEV8aXYRIdZGcV77gYSobvu3jJL038tlPAw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-lorem-ipsum": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-4.0.5.tgz", "integrity": "sha512-9a4TJYRcPWPBKkQAJ/whCu4uCAEgv/O2xAaZEI0n4y1/l18Yyx8pBKoIX5QuVXjjmKEkK7hi5SxyIsH7pFEK9Q==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-lua": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/@cspell/dict-lua/-/dict-lua-4.0.8.tgz", "integrity": "sha512-N4PkgNDMu9JVsRu7JBS/3E/dvfItRgk9w5ga2dKq+JupP2Y3lojNaAVFhXISh4Y0a6qXDn2clA6nvnavQ/jjLA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-makefile": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-makefile/-/dict-makefile-1.0.5.tgz", "integrity": "sha512-4vrVt7bGiK8Rx98tfRbYo42Xo2IstJkAF4tLLDMNQLkQ86msDlYSKG1ZCk8Abg+EdNcFAjNhXIiNO+w4KflGAQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-markdown": { "version": "2.0.17", "resolved": "https://registry.npmjs.org/@cspell/dict-markdown/-/dict-markdown-2.0.17.tgz", "integrity": "sha512-H8bAxih6U8NOnSPL7R8My+tqjaB4tmnJTjERuz4zYqmf+cH+5xshX3UVgKlwWFcyjsYfv/zEDuRdMctQv1q6HQ==", "dev": true, "license": "MIT", "peerDependencies": { "@cspell/dict-css": "^4.1.2", "@cspell/dict-html": "^4.0.15", "@cspell/dict-html-symbol-entities": "^4.0.5", "@cspell/dict-typescript": "^3.2.3" } }, "node_modules/@cspell/dict-monkeyc": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/@cspell/dict-monkeyc/-/dict-monkeyc-1.0.12.tgz", "integrity": "sha512-MN7Vs11TdP5mbdNFQP5x2Ac8zOBm97ARg6zM5Sb53YQt/eMvXOMvrep7+/+8NJXs0jkp70bBzjqU4APcqBFNAw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-node": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-node/-/dict-node-5.0.9.tgz", "integrity": "sha512-hO+ga+uYZ/WA4OtiMEyKt5rDUlUyu3nXMf8KVEeqq2msYvAPdldKBGH7lGONg6R/rPhv53Rb+0Y1SLdoK1+7wQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-npm": { "version": "5.2.41", "resolved": "https://registry.npmjs.org/@cspell/dict-npm/-/dict-npm-5.2.41.tgz", "integrity": "sha512-To3xsfRmMBYVXtWVEdUgV35M9a/JZ54dSuoY6m6D3uHKKL3I326Wmy4xifZ3PU8MQaWhyEH7zbIcUEtKwTQMcA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-php": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-php/-/dict-php-4.1.1.tgz", "integrity": "sha512-EXelI+4AftmdIGtA8HL8kr4WlUE11OqCSVlnIgZekmTkEGSZdYnkFdiJ5IANSALtlQ1mghKjz+OFqVs6yowgWA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-powershell": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/@cspell/dict-powershell/-/dict-powershell-5.0.15.tgz", "integrity": "sha512-l4S5PAcvCFcVDMJShrYD0X6Huv9dcsQPlsVsBGbH38wvuN7gS7+GxZFAjTNxDmTY1wrNi1cCatSg6Pu2BW4rgg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-public-licenses": { "version": "2.0.16", "resolved": "https://registry.npmjs.org/@cspell/dict-public-licenses/-/dict-public-licenses-2.0.16.tgz", "integrity": "sha512-EQRrPvEOmwhwWezV+W7LjXbIBjiy6y/shrET6Qcpnk3XANTzfvWflf9PnJ5kId/oKWvihFy0za0AV1JHd03pSQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-python": { "version": "4.2.27", "resolved": "https://registry.npmjs.org/@cspell/dict-python/-/dict-python-4.2.27.tgz", "integrity": "sha512-Rj6xQgYS4X6ienjgAZF+njA0GRY4oSPouJWv0vfikCTn6EWlfk0V6Dy1HP3Migj1O+IC2NmespgVq+BZNSp8OA==", "dev": true, "license": "MIT", "dependencies": { "@cspell/dict-data-science": "^2.0.14" } }, "node_modules/@cspell/dict-r": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-r/-/dict-r-2.1.1.tgz", "integrity": "sha512-71Ka+yKfG4ZHEMEmDxc6+blFkeTTvgKbKAbwiwQAuKl3zpqs1Y0vUtwW2N4b3LgmSPhV3ODVY0y4m5ofqDuKMw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-ruby": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@cspell/dict-ruby/-/dict-ruby-5.1.1.tgz", "integrity": "sha512-LHrp84oEV6q1ZxPPyj4z+FdKyq1XAKYPtmGptrd+uwHbrF/Ns5+fy6gtSi7pS+uc0zk3JdO9w/tPK+8N1/7WUA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-rust": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/@cspell/dict-rust/-/dict-rust-4.1.2.tgz", "integrity": "sha512-O1FHrumYcO+HZti3dHfBPUdnDFkI+nbYK3pxYmiM1sr+G0ebOd6qchmswS0Wsc6ZdEVNiPYJY/gZQR6jfW3uOg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-scala": { "version": "5.0.9", "resolved": "https://registry.npmjs.org/@cspell/dict-scala/-/dict-scala-5.0.9.tgz", "integrity": "sha512-AjVcVAELgllybr1zk93CJ5wSUNu/Zb5kIubymR/GAYkMyBdYFCZ3Zbwn4Zz8GJlFFAbazABGOu0JPVbeY59vGg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-shell": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@cspell/dict-shell/-/dict-shell-1.2.0.tgz", "integrity": "sha512-PVctvT22lJ49niMiakO8xieY7ELCAzjSqhejWR7bAMb5AZ9F4WDEs+XdGMnoVHWeXq7K5rcepLPmEJb+37zzIw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-software-terms": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-5.2.2.tgz", "integrity": "sha512-0CaYd6TAsKtEoA7tNswm1iptEblTzEe3UG8beG2cpSTHk7afWIVMtJLgXDv0f/Li67Lf3Z1Jf3JeXR7GsJ2TRw==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-sql": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@cspell/dict-sql/-/dict-sql-2.2.1.tgz", "integrity": "sha512-qDHF8MpAYCf4pWU8NKbnVGzkoxMNrFqBHyG/dgrlic5EQiKANCLELYtGlX5auIMDLmTf1inA0eNtv74tyRJ/vg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-svelte": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/@cspell/dict-svelte/-/dict-svelte-1.0.7.tgz", "integrity": "sha512-hGZsGqP0WdzKkdpeVLBivRuSNzOTvN036EBmpOwxH+FTY2DuUH7ecW+cSaMwOgmq5JFSdTcbTNFlNC8HN8lhaQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-swift": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@cspell/dict-swift/-/dict-swift-2.0.6.tgz", "integrity": "sha512-PnpNbrIbex2aqU1kMgwEKvCzgbkHtj3dlFLPMqW1vSniop7YxaDTtvTUO4zA++ugYAEL+UK8vYrBwDPTjjvSnA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-terraform": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@cspell/dict-terraform/-/dict-terraform-1.1.3.tgz", "integrity": "sha512-gr6wxCydwSFyyBKhBA2xkENXtVFToheqYYGFvlMZXWjviynXmh+NK/JTvTCk/VHk3+lzbO9EEQKee6VjrAUSbA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-typescript": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.3.tgz", "integrity": "sha512-zXh1wYsNljQZfWWdSPYwQhpwiuW0KPW1dSd8idjMRvSD0aSvWWHoWlrMsmZeRl4qM4QCEAjua8+cjflm41cQBg==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-vue": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@cspell/dict-vue/-/dict-vue-3.0.5.tgz", "integrity": "sha512-Mqutb8jbM+kIcywuPQCCaK5qQHTdaByoEO2J9LKFy3sqAdiBogNkrplqUK0HyyRFgCfbJUgjz3N85iCMcWH0JA==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dict-zig": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@cspell/dict-zig/-/dict-zig-1.0.0.tgz", "integrity": "sha512-XibBIxBlVosU06+M6uHWkFeT0/pW5WajDRYdXG2CgHnq85b0TI/Ks0FuBJykmsgi2CAD3Qtx8UHFEtl/DSFnAQ==", "dev": true, "license": "MIT" }, "node_modules/@cspell/dynamic-import": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-10.0.1.tgz", "integrity": "sha512-mP1gdq00aIcH8HxNMqnH11X6BKxLcneDtFgl/ecjIKnaGKwi44m8AndP5Kr4ODaYdl8UUw9O3dJh7KaQXnLHZQ==", "dev": true, "license": "MIT", "dependencies": { "@cspell/url": "10.0.1", "import-meta-resolve": "^4.2.0" }, "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/filetypes": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-10.0.1.tgz", "integrity": "sha512-Z5S35giU5IW49fBBq6BksUbE8PC4IYPfaKuwl5Nl9jkf/OkAKiBmCowKX45NzRUQInwK/GSqqIUifrNeI6LdLw==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/rpc": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/rpc/-/rpc-10.0.1.tgz", "integrity": "sha512-axSRKv3zEAmBm66iD/FV/MPmE4/Yf7c3PZiwTW894Yd3iEhtn3KPKeTrqQ2/tDrhB1Z2qTsap/Hue0MK4o5WXg==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/strong-weak-map": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-10.0.1.tgz", "integrity": "sha512-lenN1DVyPi8nJLSMSJJ670ddTjyiruLueuSZO1qLcxBqUhgxDt/mALu9N/1m6WdOVcg6m/5cLiZVg2KOo2UzRw==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@cspell/url": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/@cspell/url/-/url-10.0.1.tgz", "integrity": "sha512-abYYgI29wJhWIfWTYrYuzRYDcHQUQ1N5ylnhxYn1NJnIQMqUWGLbDmt12JABtZ+R6h6UNatQrS7rhP86etvJyQ==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" } }, "node_modules/@es-joy/jsdoccomment": { "version": "0.86.0", "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.86.0.tgz", "integrity": "sha512-ukZmRQ81WiTpDWO6D/cTBM7XbrNtutHKvAVnZN/8pldAwLoJArGOvkNyxPTBGsPjsoaQBJxlH+tE2TNA/92Qgw==", "dev": true, "license": "MIT", "dependencies": { "@types/estree": "^1.0.8", "@typescript-eslint/types": "^8.58.0", "comment-parser": "1.4.6", "esquery": "^1.7.0", "jsdoc-type-pratt-parser": "~7.2.0" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@es-joy/resolve.exports": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@es-joy/resolve.exports/-/resolve.exports-1.2.0.tgz", "integrity": "sha512-Q9hjxWI5xBM+qW2enxfe8wDKdFWMfd0Z29k5ZJnuBqD/CasY5Zryj09aCA6owbGATWz+39p5uIdaHXpopOcG8g==", "dev": true, "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/@eslint-community/eslint-utils": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "license": "Apache-2.0", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint-community/regexpp": { "version": "4.12.2", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/config-array": { "version": "0.21.2", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.5" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/config-helpers": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/core": "^0.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/core": { "version": "0.17.0", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.15" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.14.0", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.1", "minimatch": "^3.1.5", "strip-json-comments": "^3.1.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/eslintrc/node_modules/import-fresh": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "license": "MIT", "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@eslint/eslintrc/node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/@eslint/js": { "version": "9.39.4", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", "dev": true, "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://eslint.org/donate" } }, "node_modules/@eslint/markdown": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@eslint/markdown/-/markdown-8.0.2.tgz", "integrity": "sha512-W+/0qHp0WbvFEljUvvECNpSWrUHpBWIWwp7F3QqEwQKmaRCmfEWvk6VfUia9pTQ0th6HyBGBsPfg/kG3/aQxLA==", "dev": true, "license": "MIT", "workspaces": [ "examples/*" ], "dependencies": { "@eslint/core": "^1.2.1", "@eslint/plugin-kit": "^0.7.1", "github-slugger": "^2.0.0", "mdast-util-from-markdown": "^2.0.2", "mdast-util-frontmatter": "^2.0.1", "mdast-util-gfm": "^3.1.0", "mdast-util-math": "^3.0.0", "micromark-extension-frontmatter": "^2.0.0", "micromark-extension-gfm": "^3.0.0", "micromark-extension-math": "^3.1.0", "micromark-util-normalize-identifier": "^2.0.1" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/markdown/node_modules/@eslint/core": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz", "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.15" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/markdown/node_modules/@eslint/plugin-kit": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz", "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/core": "^1.2.1", "levn": "^0.4.1" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/object-schema": { "version": "2.1.7", "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/plugin-kit": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/core": "^0.17.0", "levn": "^0.4.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@humanfs/core": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", "dev": true, "license": "Apache-2.0", "dependencies": { "@humanfs/types": "^0.15.0" }, "engines": { "node": ">=18.18.0" } }, "node_modules/@humanfs/node": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "@humanfs/core": "^0.19.2", "@humanfs/types": "^0.15.0", "@humanwhocodes/retry": "^0.4.0" }, "engines": { "node": ">=18.18.0" } }, "node_modules/@humanfs/types": { "version": "0.15.0", "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=18.18.0" } }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=12.22" }, "funding": { "type": "github", "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/retry": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=18.18" }, "funding": { "type": "github", "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@inquirer/external-editor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz", "integrity": "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==", "dev": true, "license": "MIT", "dependencies": { "chardet": "^2.1.1", "iconv-lite": "^0.7.0" }, "engines": { "node": ">=18" }, "peerDependencies": { "@types/node": ">=18" }, "peerDependenciesMeta": { "@types/node": { "optional": true } } }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "node_modules/@jridgewell/remapping": { "version": "2.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { "version": "0.3.11", "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.31", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@jsdevtools/ono": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", "dev": true, "license": "MIT" }, "node_modules/@jsonjoy.com/base64": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-1.1.2.tgz", "integrity": "sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/buffers": { "version": "17.67.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/buffers/-/buffers-17.67.0.tgz", "integrity": "sha512-tfExRpYxBvi32vPs9ZHaTjSP4fHAfzSmcahOfNxtvGHcyJel+aibkPlGeBB+7AoC6hL7lXIE++8okecBxx7lcw==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/codegen": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/codegen/-/codegen-1.0.0.tgz", "integrity": "sha512-E8Oy+08cmCf0EK/NMxpaJZmOxPqM+6iSe2S4nlSBrPZOORoDJILxtbSUEDKQyTamm/BVAhIGllOBNU79/dwf0g==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-core": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-core/-/fs-core-4.57.8.tgz", "integrity": "sha512-YzVbwggV9452VCeHgo0bjsTaUt1O7JE0XpEsPar93nn/+RAwXk0mb1Y+f5EDJ3TRtRCFe+Ck5RuojdfB4jeHVw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/fs-node-builtins": "4.57.8", "@jsonjoy.com/fs-node-utils": "4.57.8", "thingies": "^2.5.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-fsa": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-fsa/-/fs-fsa-4.57.8.tgz", "integrity": "sha512-vmClyvCQMxgqz7uamDiGtRfp4MjzOznk3pcQjCxlIwJcw7TWeyr+bF30hI0x8NxdtNOGMg1pHM74VDIXOeyjuw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/fs-core": "4.57.8", "@jsonjoy.com/fs-node-builtins": "4.57.8", "@jsonjoy.com/fs-node-utils": "4.57.8", "thingies": "^2.5.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-node": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-node/-/fs-node-4.57.8.tgz", "integrity": "sha512-IPEOlDYSnTDYpjQlQg2F8h+eqxKQN3sdbroI0WrteRiQZ462HzVpBo9ZZX485njz4nAacoe3fd4iDiIhk+k5Hg==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/fs-core": "4.57.8", "@jsonjoy.com/fs-node-builtins": "4.57.8", "@jsonjoy.com/fs-node-utils": "4.57.8", "@jsonjoy.com/fs-print": "4.57.8", "@jsonjoy.com/fs-snapshot": "4.57.8", "glob-to-regex.js": "^1.0.0", "thingies": "^2.5.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-node-builtins": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-node-builtins/-/fs-node-builtins-4.57.8.tgz", "integrity": "sha512-mxXSXw8zZwRVakcjLqR2I/psy4gURFSASZS10kKJ2kJw05GC2nXGroGrWVHxwgkxXgQLsFQnB74QaLzsxzdL/w==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-node-to-fsa": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-node-to-fsa/-/fs-node-to-fsa-4.57.8.tgz", "integrity": "sha512-AWZcT/4+H+iDl4XCukbXrarvwEgOrf/prFI5/7eg4ix9FxqVsZysIDJd1Kjd+AjlCeHKHJOaRqjLd5HiGSCJEw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/fs-fsa": "4.57.8", "@jsonjoy.com/fs-node-builtins": "4.57.8", "@jsonjoy.com/fs-node-utils": "4.57.8" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-node-utils": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-node-utils/-/fs-node-utils-4.57.8.tgz", "integrity": "sha512-E/bJ7sQAb4pu9nbeJhbULU3WnqWrswte4N9Js/oHt7aHB746S8/XBqKlcbrqIgnD3095XluovNEZuu5ONT230g==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/fs-node-builtins": "4.57.8" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-print": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-print/-/fs-print-4.57.8.tgz", "integrity": "sha512-DfzhOBpmvNu5P/KSe4NNQaOnvNliTdcf0qrh/4EReErF/XUQXYkd0vZl/OiJCm/qjEEo8DWRstliw2/JNS84dA==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/fs-node-utils": "4.57.8", "tree-dump": "^1.1.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-snapshot": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/@jsonjoy.com/fs-snapshot/-/fs-snapshot-4.57.8.tgz", "integrity": "sha512-L+eqKaWOHLDaiMv1dh/EWQ4hA+o6xAhWSumTo3Teg7OM18jU/KE13/e8Mfal+eAZ/pSl4wIhKHcDiwapJzC8Wg==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/buffers": "^17.65.0", "@jsonjoy.com/fs-node-utils": "4.57.8", "@jsonjoy.com/json-pack": "^17.65.0", "@jsonjoy.com/util": "^17.65.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-snapshot/node_modules/@jsonjoy.com/base64": { "version": "17.67.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/base64/-/base64-17.67.0.tgz", "integrity": "sha512-5SEsJGsm15aP8TQGkDfJvz9axgPwAEm98S5DxOuYe8e1EbfajcDmgeXXzccEjh+mLnjqEKrkBdjHWS5vFNwDdw==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-snapshot/node_modules/@jsonjoy.com/codegen": { "version": "17.67.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/codegen/-/codegen-17.67.0.tgz", "integrity": "sha512-idnkUplROpdBOV0HMcwhsCUS5TRUi9poagdGs70A6S4ux9+/aPuKbh8+UYRTLYQHtXvAdNfQWXDqZEx5k4Dj2Q==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-snapshot/node_modules/@jsonjoy.com/json-pack": { "version": "17.67.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-17.67.0.tgz", "integrity": "sha512-t0ejURcGaZsn1ClbJ/3kFqSOjlryd92eQY465IYrezsXmPcfHPE/av4twRSxf6WE+TkZgLY+71vCZbiIiFKA/w==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/base64": "17.67.0", "@jsonjoy.com/buffers": "17.67.0", "@jsonjoy.com/codegen": "17.67.0", "@jsonjoy.com/json-pointer": "17.67.0", "@jsonjoy.com/util": "17.67.0", "hyperdyperid": "^1.2.0", "thingies": "^2.5.0", "tree-dump": "^1.1.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-snapshot/node_modules/@jsonjoy.com/json-pointer": { "version": "17.67.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pointer/-/json-pointer-17.67.0.tgz", "integrity": "sha512-+iqOFInH+QZGmSuaybBUNdh7yvNrXvqR+h3wjXm0N/3JK1EyyFAeGJvqnmQL61d1ARLlk/wJdFKSL+LHJ1eaUA==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/util": "17.67.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/fs-snapshot/node_modules/@jsonjoy.com/util": { "version": "17.67.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-17.67.0.tgz", "integrity": "sha512-6+8xBaz1rLSohlGh68D1pdw3AwDi9xydm8QNlAFkvnavCJYSze+pxoW2VKP8p308jtlMRLs5NTHfPlZLd4w7ew==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/buffers": "17.67.0", "@jsonjoy.com/codegen": "17.67.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/json-pack": { "version": "1.21.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pack/-/json-pack-1.21.0.tgz", "integrity": "sha512-+AKG+R2cfZMShzrF2uQw34v3zbeDYUqnQ+jg7ORic3BGtfw9p/+N6RJbq/kkV8JmYZaINknaEQ2m0/f693ZPpg==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/base64": "^1.1.2", "@jsonjoy.com/buffers": "^1.2.0", "@jsonjoy.com/codegen": "^1.0.0", "@jsonjoy.com/json-pointer": "^1.0.2", "@jsonjoy.com/util": "^1.9.0", "hyperdyperid": "^1.2.0", "thingies": "^2.5.0", "tree-dump": "^1.1.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/json-pack/node_modules/@jsonjoy.com/buffers": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@jsonjoy.com/buffers/-/buffers-1.2.1.tgz", "integrity": "sha512-12cdlDwX4RUM3QxmUbVJWqZ/mrK6dFQH4Zxq6+r1YXKXYBNgZXndx2qbCJwh3+WWkCSn67IjnlG3XYTvmvYtgA==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/json-pointer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/@jsonjoy.com/json-pointer/-/json-pointer-1.0.2.tgz", "integrity": "sha512-Fsn6wM2zlDzY1U+v4Nc8bo3bVqgfNTGcn6dMgs6FjrEnt4ZCe60o6ByKRjOGlI2gow0aE/Q41QOigdTqkyK5fg==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/codegen": "^1.0.0", "@jsonjoy.com/util": "^1.9.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/util": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.9.0.tgz", "integrity": "sha512-pLuQo+VPRnN8hfPqUTLTHk126wuYdXVxE6aDmjSeV4NCAgyxWbiOIeNJVtID3h1Vzpoi9m4jXezf73I6LgabgQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/buffers": "^1.0.0", "@jsonjoy.com/codegen": "^1.0.0" }, "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@jsonjoy.com/util/node_modules/@jsonjoy.com/buffers": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@jsonjoy.com/buffers/-/buffers-1.2.1.tgz", "integrity": "sha512-12cdlDwX4RUM3QxmUbVJWqZ/mrK6dFQH4Zxq6+r1YXKXYBNgZXndx2qbCJwh3+WWkCSn67IjnlG3XYTvmvYtgA==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/@manypkg/find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@manypkg/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==", "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.5.5", "@types/node": "^12.7.1", "find-up": "^4.1.0", "fs-extra": "^8.1.0" } }, "node_modules/@manypkg/find-root/node_modules/@types/node": { "version": "12.20.55", "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", "dev": true, "license": "MIT" }, "node_modules/@manypkg/find-root/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "license": "MIT", "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/@manypkg/find-root/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" }, "engines": { "node": ">=6 <7 || >=8" } }, "node_modules/@manypkg/find-root/node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "license": "MIT", "dependencies": { "p-locate": "^4.1.0" }, "engines": { "node": ">=8" } }, "node_modules/@manypkg/find-root/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "license": "MIT", "dependencies": { "p-try": "^2.0.0" }, "engines": { "node": ">=6" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@manypkg/find-root/node_modules/p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "license": "MIT", "dependencies": { "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, "node_modules/@manypkg/find-root/node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@manypkg/get-packages": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@manypkg/get-packages/-/get-packages-1.1.3.tgz", "integrity": "sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==", "dev": true, "license": "MIT", "dependencies": { "@babel/runtime": "^7.5.5", "@changesets/types": "^4.0.1", "@manypkg/find-root": "^1.1.0", "fs-extra": "^8.1.0", "globby": "^11.0.0", "read-yaml-file": "^1.1.0" } }, "node_modules/@manypkg/get-packages/node_modules/@changesets/types": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@changesets/types/-/types-4.1.0.tgz", "integrity": "sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==", "dev": true, "license": "MIT" }, "node_modules/@manypkg/get-packages/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" }, "engines": { "node": ">=6 <7 || >=8" } }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" }, "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" }, "engines": { "node": ">= 8" } }, "node_modules/@pkgr/core": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.3.6.tgz", "integrity": "sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==", "dev": true, "license": "MIT", "engines": { "node": "^14.18.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/pkgr" } }, "node_modules/@rtsao/scc": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", "dev": true, "license": "MIT" }, "node_modules/@sindresorhus/base62": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@sindresorhus/base62/-/base62-1.0.0.tgz", "integrity": "sha512-TeheYy0ILzBEI/CO55CP6zJCSdSWeRtGnHy8U8dWSUH4I68iqTsy7HkMktR4xakThc9jotkPQUXT4ITdbV7cHA==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@stylistic/eslint-plugin": { "version": "5.10.0", "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.10.0.tgz", "integrity": "sha512-nPK52ZHvot8Ju/0A4ucSX1dcPV2/1clx0kLcH5wDmrE4naKso7TUC/voUyU1O9OTKTrR6MYip6LP0ogEMQ9jPQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/types": "^8.56.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "estraverse": "^5.3.0", "picomatch": "^4.0.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "peerDependencies": { "eslint": "^9.0.0 || ^10.0.0" } }, "node_modules/@types/debug": { "version": "4.1.13", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", "dev": true, "license": "MIT", "dependencies": { "@types/ms": "*" } }, "node_modules/@types/estree": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true, "license": "MIT" }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/@types/hast": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", "dev": true, "license": "MIT", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true, "license": "MIT" }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true, "license": "MIT" }, "node_modules/@types/katex": { "version": "0.16.8", "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.8.tgz", "integrity": "sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==", "dev": true, "license": "MIT" }, "node_modules/@types/lodash": { "version": "4.17.24", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.24.tgz", "integrity": "sha512-gIW7lQLZbue7lRSWEFql49QJJWThrTFFeIMJdp3eH4tKoxm1OvEPg02rm4wCCSHS0cL3/Fizimb35b7k8atwsQ==", "dev": true, "license": "MIT" }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "dev": true, "license": "MIT", "dependencies": { "@types/unist": "*" } }, "node_modules/@types/ms": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { "version": "24.13.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.1.tgz", "integrity": "sha512-RSpUJGmvsJ1ZeBehQZFhIdpsz+bIpES0nIQXko4Ybq+N+kX6XvOq3Jo+iJ82FWLdblFq85AsMikd3m35jgezYg==", "dev": true, "license": "MIT", "dependencies": { "undici-types": "~7.18.0" } }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true, "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.61.0.tgz", "integrity": "sha512-bFNvl9ZczlVb+wR2Akszf3gHfKVj/8WanXaGJ3UstTA7brNKg0cNdk6X1Psu5V7MZ2oQtzZKOEzIUehaoxbDGw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.61.0", "@typescript-eslint/type-utils": "8.61.0", "@typescript-eslint/utils": "8.61.0", "@typescript-eslint/visitor-keys": "8.61.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "@typescript-eslint/parser": "^8.61.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "dev": true, "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/@typescript-eslint/parser": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.61.0.tgz", "integrity": "sha512-5B7PfA2e1NQGCnDHd/0lW7W3gvp3d59Ryw54FYO8Uswxo9f6ikw3AZV+Xj/TvpImmpsiYyUqAfhC6kJID1jF6w==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/scope-manager": "8.61.0", "@typescript-eslint/types": "8.61.0", "@typescript-eslint/typescript-estree": "8.61.0", "@typescript-eslint/visitor-keys": "8.61.0", "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/project-service": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.61.0.tgz", "integrity": "sha512-DV42F7MLJO6Rax7SK1yg43tcnEfGUrurSpSxKuVX+a3RCTzBlH3fuxprrOJXKCJGAaw82xXocikJ0uQaqwXgGA==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.61.0", "@typescript-eslint/types": "^8.61.0", "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/scope-manager": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.61.0.tgz", "integrity": "sha512-IWdXFHFSb6mlC3HPc7QsLDm5zYEbUla6trDEHf32D3/dnuUyXd87plScSNXSbm0/RxMvObpI17sv/EDTGrGZkA==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/types": "8.61.0", "@typescript-eslint/visitor-keys": "8.61.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/tsconfig-utils": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.61.0.tgz", "integrity": "sha512-O5Amvdv9ztMpxpf+vmFULGG78IE6Qwdr3bCGvqwG4nwc9H2qXkOYJJnRbRHyMkQTjv1d03olqwwwzHLMqpFePQ==", "dev": true, "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/type-utils": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.61.0.tgz", "integrity": "sha512-TuBiQYIkd97yBfInHCTKVYMbX4kvEmpOEuixIuzCU9p8BGT1SfyyO0d0IfDMbPIHcjn/hWnusUX5e8v5Xg+X8A==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/types": "8.61.0", "@typescript-eslint/typescript-estree": "8.61.0", "@typescript-eslint/utils": "8.61.0", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/types": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.61.0.tgz", "integrity": "sha512-9QTQpZ5Iin4CdIodfbDQFSeiSJKidgYJYug1P9CC2xWgUTvlmixViqDZNciMjwLBZyJnG4tGmPl97rVAFb1AJg==", "dev": true, "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/typescript-estree": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.61.0.tgz", "integrity": "sha512-42zatd5qSvvcV1JdDBCLxYRznvP4eIHpPoZXdkPFnAmanA4FuZ5dibSnCBggY8hQnqajPpoGjXFdZ7fIJKQnlA==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/project-service": "8.61.0", "@typescript-eslint/tsconfig-utils": "8.61.0", "@typescript-eslint/types": "8.61.0", "@typescript-eslint/visitor-keys": "8.61.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, "license": "MIT", "engines": { "node": "18 || 20 || >=22" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" }, "engines": { "node": "18 || 20 || >=22" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "version": "10.2.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "brace-expansion": "^5.0.5" }, "engines": { "node": "18 || 20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@typescript-eslint/utils": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.61.0.tgz", "integrity": "sha512-3bzFt7ImFMW/jVYwJamDoe/dMOdFLSC6pom6rRjdh4SZJEYupyMzem8e7vKZLclLfpHjlwSAXOUxtKxGXUiLqA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.61.0", "@typescript-eslint/types": "8.61.0", "@typescript-eslint/typescript-estree": "8.61.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/visitor-keys": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.61.0.tgz", "integrity": "sha512-QVLZu3ZPQEE+HICQyAMZ2yLQhxf0meY/wx6Hx14YcTNj13JB3qHlX3lJ02L3fLGHgERRH71kvYDwiXIguT3AjQ==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/types": "8.61.0", "eslint-visitor-keys": "^5.0.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "license": "Apache-2.0", "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/helper-numbers": "1.13.2", "@webassemblyjs/helper-wasm-bytecode": "1.13.2" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-buffer": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.13.2", "@webassemblyjs/helper-api-error": "1.13.2", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/helper-wasm-section": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.14.1", "@webassemblyjs/helper-buffer": "1.14.1", "@webassemblyjs/helper-wasm-bytecode": "1.13.2", "@webassemblyjs/wasm-gen": "1.14.1" } }, "node_modules/@webassemblyjs/ieee754": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", "dev": true, "license": "MIT", "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", "dev": true, "license": "Apache-2.0", "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", "dev": true, "license": "MIT" }, "node_modules/@webassemblyjs/wasm-edit": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.14.1", "@webassemblyjs/helper-buffer": "1.14.1", "@webassemblyjs/helper-wasm-bytecode": "1.13.2", "@webassemblyjs/helper-wasm-section": "1.14.1", "@webassemblyjs/wasm-gen": "1.14.1", "@webassemblyjs/wasm-opt": "1.14.1", "@webassemblyjs/wasm-parser": "1.14.1", "@webassemblyjs/wast-printer": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-gen": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.14.1", "@webassemblyjs/helper-wasm-bytecode": "1.13.2", "@webassemblyjs/ieee754": "1.13.2", "@webassemblyjs/leb128": "1.13.2", "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wasm-opt": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.14.1", "@webassemblyjs/helper-buffer": "1.14.1", "@webassemblyjs/wasm-gen": "1.14.1", "@webassemblyjs/wasm-parser": "1.14.1" } }, "node_modules/@webassemblyjs/wasm-parser": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.14.1", "@webassemblyjs/helper-api-error": "1.13.2", "@webassemblyjs/helper-wasm-bytecode": "1.13.2", "@webassemblyjs/ieee754": "1.13.2", "@webassemblyjs/leb128": "1.13.2", "@webassemblyjs/utf8": "1.13.2" } }, "node_modules/@webassemblyjs/wast-printer": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", "dev": true, "license": "MIT", "dependencies": { "@webassemblyjs/ast": "1.14.1", "@xtuc/long": "4.2.2" } }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/@xtuc/long": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true, "license": "Apache-2.0" }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", "dev": true, "license": "BSD-2-Clause" }, "node_modules/acorn": { "version": "8.16.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", "bin": { "acorn": "bin/acorn" }, "engines": { "node": ">=0.4.0" } }, "node_modules/acorn-import-phases": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", "dev": true, "license": "MIT", "engines": { "node": ">=10.13.0" }, "peerDependencies": { "acorn": "^8.14.0" } }, "node_modules/acorn-jsx": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "license": "MIT", "dependencies": { "debug": "4" }, "engines": { "node": ">= 6.0.0" } }, "node_modules/ajv": { "version": "6.15.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ajv-formats": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "dev": true, "license": "MIT", "dependencies": { "ajv": "^8.0.0" }, "peerDependencies": { "ajv": "^8.0.0" }, "peerDependenciesMeta": { "ajv": { "optional": true } } }, "node_modules/ajv-formats/node_modules/ajv": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/ajv-formats/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT" }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/ansi-escapes": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz", "integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==", "dev": true, "license": "MIT", "dependencies": { "environment": "^1.0.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-regex": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { "version": "6.2.3", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/are-docs-informative": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", "dev": true, "license": "MIT", "engines": { "node": ">=14" } }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, "license": "Python-2.0" }, "node_modules/array-buffer-byte-length": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "is-array-buffer": "^3.0.5" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-includes": { "version": "3.1.9", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.24.0", "es-object-atoms": "^1.1.1", "get-intrinsic": "^1.3.0", "is-string": "^1.1.1", "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array-timsort": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-timsort/-/array-timsort-1.0.3.tgz", "integrity": "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==", "dev": true, "license": "MIT" }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/array.prototype.findlast": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array.prototype.findlastindex": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "es-shim-unscopables": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array.prototype.flat": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array.prototype.flatmap": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/array.prototype.tosorted": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.3", "es-errors": "^1.3.0", "es-shim-unscopables": "^1.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "dev": true, "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "is-array-buffer": "^3.0.4" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/async-function": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", "dev": true, "license": "MIT" }, "node_modules/available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, "license": "MIT", "dependencies": { "possible-typed-array-names": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/axios": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/axios/-/axios-1.18.1.tgz", "integrity": "sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g==", "dev": true, "license": "MIT", "dependencies": { "follow-redirects": "^1.16.0", "form-data": "^4.0.5", "https-proxy-agent": "^5.0.1", "proxy-from-env": "^2.1.0" } }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true, "license": "MIT" }, "node_modules/baseline-browser-mapping": { "version": "2.10.35", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.35.tgz", "integrity": "sha512-honAfLBde0HAFLdNyBEfuuENkF6zR+ozxqxa/2zJKHBe1qzLqyTSeRKpdPEHAP03rlDGyQOPnCSxnVpVqQo9Mg==", "dev": true, "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" }, "engines": { "node": ">=6.0.0" } }, "node_modules/better-path-resolve": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/better-path-resolve/-/better-path-resolve-1.0.0.tgz", "integrity": "sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==", "dev": true, "license": "MIT", "dependencies": { "is-windows": "^1.0.0" }, "engines": { "node": ">=4" } }, "node_modules/brace-expansion": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "node_modules/braces": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, "engines": { "node": ">=8" } }, "node_modules/browserslist": { "version": "4.28.2", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz", "integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "baseline-browser-mapping": "^2.10.12", "caniuse-lite": "^1.0.30001782", "electron-to-chromium": "^1.5.328", "node-releases": "^2.0.36", "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" }, "engines": { "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true, "license": "MIT" }, "node_modules/builtin-modules": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-5.2.0.tgz", "integrity": "sha512-02yxLeyxF4dNl6SlY6/5HfRSrSdZ/sCPoxy2kZNP5dZZX8LSAD9aE2gtJIUgWrsQTiMPl3mxESyrobSwvRGisQ==", "dev": true, "license": "MIT", "engines": { "node": ">=18.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/call-bind": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "get-intrinsic": "^1.3.0", "set-function-length": "^1.2.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/call-bound": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { "version": "1.0.30001797", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001797.tgz", "integrity": "sha512-l8xKG+gwAIExZGl9FrF7KUwuOmk6wbEPC9Xoy/RtnWv1XG0Q4LFlagaLpUv3Kiza3W/wm27zy0yWJEieYKAP6w==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/caniuse-lite" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "CC-BY-4.0" }, "node_modules/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", "dev": true, "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/chalk": { "version": "5.6.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", "dev": true, "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/chalk-template": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-1.1.2.tgz", "integrity": "sha512-2bxTP2yUH7AJj/VAXfcA+4IcWGdQ87HwBANLt5XxGTeomo8yG0y95N1um9i5StvhT/Bl0/2cARA5v1PpPXUxUA==", "dev": true, "license": "MIT", "dependencies": { "chalk": "^5.2.0" }, "engines": { "node": ">=14.16" }, "funding": { "url": "https://github.com/chalk/chalk-template?sponsor=1" } }, "node_modules/change-case": { "version": "5.4.4", "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", "dev": true, "license": "MIT" }, "node_modules/character-entities": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", "dev": true, "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/chardet": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", "dev": true, "license": "MIT" }, "node_modules/chrome-trace-event": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, "license": "MIT", "engines": { "node": ">=6.0" } }, "node_modules/ci-info": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/sibiraj-s" } ], "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/clean-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", "integrity": "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==", "dev": true, "license": "MIT", "dependencies": { "escape-string-regexp": "^1.0.5" }, "engines": { "node": ">=4" } }, "node_modules/clean-regexp/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/cli-cursor": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz", "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==", "dev": true, "license": "MIT", "dependencies": { "restore-cursor": "^5.0.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cli-truncate": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz", "integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==", "dev": true, "license": "MIT", "dependencies": { "slice-ansi": "^8.0.0", "string-width": "^8.2.0" }, "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "node_modules/cliui/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/cliui/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/cliui/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, "engines": { "node": ">=7.0.0" } }, "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, "license": "MIT" }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, "engines": { "node": ">= 0.8" } }, "node_modules/commander": { "version": "14.0.3", "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", "dev": true, "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/comment-json": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/comment-json/-/comment-json-5.0.0.tgz", "integrity": "sha512-uiqLcOiVDJtBP8WGkZHEP+FZIhTzP1dxvn59EfoYUi9gqupjrBWVQkO2atDrbnKPwLeotFYDsuNb26uBMqB+hw==", "dev": true, "license": "MIT", "dependencies": { "array-timsort": "^1.0.3", "esprima": "^4.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/comment-parser": { "version": "1.4.6", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.6.tgz", "integrity": "sha512-ObxuY6vnbWTN6Od72xfwN9DbzC7Y2vv8u1Soi9ahRKL37gb6y1qk6/dgjs+3JWuXJHWvsg3BXIwzd/rkmAwavg==", "dev": true, "license": "MIT", "engines": { "node": ">= 12.0.0" } }, "node_modules/commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true, "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true, "license": "MIT" }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true, "license": "MIT" }, "node_modules/core-js-compat": { "version": "3.49.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.49.0.tgz", "integrity": "sha512-VQXt1jr9cBz03b331DFDCCP90b3fanciLkgiOoy8SBHy06gNf+vQ1A3WFLqG7I8TipYIKeYK9wxd0tUrvHcOZA==", "dev": true, "license": "MIT", "dependencies": { "browserslist": "^4.28.1" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" } }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" }, "engines": { "node": ">= 8" } }, "node_modules/cspell": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell/-/cspell-10.0.1.tgz", "integrity": "sha512-Gg6w/flT3fKfl3la62hfTnhtNnDQ+9mU7kUhVqw/axl/Ms4oENw0oJMkWFIoj4f6nL/SDPz7KcPXd2XbkKFNmQ==", "dev": true, "license": "MIT", "dependencies": { "@cspell/cspell-json-reporter": "10.0.1", "@cspell/cspell-performance-monitor": "10.0.1", "@cspell/cspell-pipe": "10.0.1", "@cspell/cspell-types": "10.0.1", "@cspell/cspell-worker": "10.0.1", "@cspell/dynamic-import": "10.0.1", "@cspell/url": "10.0.1", "ansi-regex": "^6.2.2", "chalk": "^5.6.2", "chalk-template": "^1.1.2", "commander": "^14.0.3", "cspell-config-lib": "10.0.1", "cspell-dictionary": "10.0.1", "cspell-gitignore": "10.0.1", "cspell-glob": "10.0.1", "cspell-io": "10.0.1", "cspell-lib": "10.0.1", "fast-json-stable-stringify": "^2.1.0", "flatted": "^3.4.2", "semver": "^7.8.1", "tinyglobby": "^0.2.16" }, "bin": { "cspell": "bin.mjs", "cspell-esm": "bin.mjs" }, "engines": { "node": ">=22.18.0" }, "funding": { "url": "https://github.com/streetsidesoftware/cspell?sponsor=1" } }, "node_modules/cspell-config-lib": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-10.0.1.tgz", "integrity": "sha512-hMpo/0j6k7pbiqrLDOLJKD2IGP9XwhjKf2miiM6p84Xeo4nyuFZaxxDCQ68R851HSYFrrdltgpoipMbj1h2Tnw==", "dev": true, "license": "MIT", "dependencies": { "@cspell/cspell-types": "10.0.1", "comment-json": "^5.0.0", "smol-toml": "^1.6.1", "yaml": "^2.9.0" }, "engines": { "node": ">=22.18.0" } }, "node_modules/cspell-dictionary": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-10.0.1.tgz", "integrity": "sha512-3cZ659vgsZWkzGQJR/sNqGDVt/OnvTSieLKI76V++4t1bHJfochb9ZrrwsuMsb1VPGiyqClUP1/O6WrefF/FVg==", "dev": true, "license": "MIT", "dependencies": { "@cspell/cspell-performance-monitor": "10.0.1", "@cspell/cspell-pipe": "10.0.1", "@cspell/cspell-types": "10.0.1", "cspell-trie-lib": "10.0.1", "fast-equals": "^6.0.0" }, "engines": { "node": ">=22.18.0" } }, "node_modules/cspell-gitignore": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-10.0.1.tgz", "integrity": "sha512-wN23U61Mx6qPJN3CesOmBU9vnbJ0jQm/ylK0iaVui3CcnO7Zzl5qLu5mPHUzGQGm8yso6qjyxqo16Ho7LpZGOQ==", "dev": true, "license": "MIT", "dependencies": { "@cspell/url": "10.0.1", "cspell-glob": "10.0.1", "cspell-io": "10.0.1" }, "bin": { "cspell-gitignore": "bin.mjs" }, "engines": { "node": ">=22.18.0" } }, "node_modules/cspell-glob": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-10.0.1.tgz", "integrity": "sha512-7bII9J3aSSpZDwhx7w+zfQXbMxHZQ3be0ilUp5bHrsjz6o07v/NqOHMGcwKdPn1sw2dxDz9sv057xE5pqXnSdw==", "dev": true, "license": "MIT", "dependencies": { "@cspell/url": "10.0.1", "picomatch": "^4.0.4" }, "engines": { "node": ">=22.18.0" } }, "node_modules/cspell-grammar": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-10.0.1.tgz", "integrity": "sha512-xC9AFYmaI9wsO//a7S5tdDGKGJVD5UEEsTg+Up2fi7lPfXIryisYmV6tePNL1SEg0idYss4ja8LUZ3Mib09BjQ==", "dev": true, "license": "MIT", "dependencies": { "@cspell/cspell-pipe": "10.0.1", "@cspell/cspell-types": "10.0.1" }, "bin": { "cspell-grammar": "bin.mjs" }, "engines": { "node": ">=22.18.0" } }, "node_modules/cspell-io": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-10.0.1.tgz", "integrity": "sha512-8C2ka07faxflnaqEBO3pektS21XViE/SEHT7F5ZD1ou7FyMR5u3xawTBJSczClfsxLt/WYeztBYrpmGAjmjksw==", "dev": true, "license": "MIT", "dependencies": { "@cspell/cspell-service-bus": "10.0.1", "@cspell/url": "10.0.1" }, "engines": { "node": ">=22.18.0" } }, "node_modules/cspell-lib": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-10.0.1.tgz", "integrity": "sha512-RpsIPiLzc4/YMW8BMRKpyJ81x439qjYWcqgdKeXnMkbKM88J9PexzutfFf/4v97v96KzfNitEzMpbI0uj8OeUg==", "dev": true, "license": "MIT", "dependencies": { "@cspell/cspell-bundled-dicts": "10.0.1", "@cspell/cspell-performance-monitor": "10.0.1", "@cspell/cspell-pipe": "10.0.1", "@cspell/cspell-resolver": "10.0.1", "@cspell/cspell-types": "10.0.1", "@cspell/dynamic-import": "10.0.1", "@cspell/filetypes": "10.0.1", "@cspell/rpc": "10.0.1", "@cspell/strong-weak-map": "10.0.1", "@cspell/url": "10.0.1", "cspell-config-lib": "10.0.1", "cspell-dictionary": "10.0.1", "cspell-glob": "10.0.1", "cspell-grammar": "10.0.1", "cspell-io": "10.0.1", "cspell-trie-lib": "10.0.1", "env-paths": "^4.0.0", "gensequence": "^8.0.8", "import-fresh": "^4.0.0", "resolve-from": "^5.0.0", "vscode-languageserver-textdocument": "^1.0.12", "vscode-uri": "^3.1.0", "xdg-basedir": "^5.1.0" }, "engines": { "node": ">=22.18.0" } }, "node_modules/cspell-trie-lib": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-10.0.1.tgz", "integrity": "sha512-BFvhalSkRQFjKrZ//FKK7fRGrZFpifnxB5AwCkzsIsBZqicsfafcQ1xP21qpb0QqyV/IomjNgviG+tRJs+0rMw==", "dev": true, "license": "MIT", "engines": { "node": ">=22.18.0" }, "peerDependencies": { "@cspell/cspell-types": "10.0.1" } }, "node_modules/data-view-buffer": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/data-view-byte-length": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/inspect-js" } }, "node_modules/data-view-byte-offset": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/dataloader": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-1.4.0.tgz", "integrity": "sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.3" }, "engines": { "node": ">=6.0" }, "peerDependenciesMeta": { "supports-color": { "optional": true } } }, "node_modules/decode-named-character-reference": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", "dev": true, "license": "MIT", "dependencies": { "character-entities": "^2.0.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, "license": "MIT" }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/define-properties": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/detect-indent": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/detect-newline": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", "dev": true, "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/devlop": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dev": true, "license": "MIT", "dependencies": { "dequal": "^2.0.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "license": "Apache-2.0", "dependencies": { "esutils": "^2.0.2" }, "engines": { "node": ">=0.10.0" } }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/electron-to-chromium": { "version": "1.5.370", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.370.tgz", "integrity": "sha512-D5tSHJReAb/Kf3Hu9F/GO4lJuSWzEWHwvQ/kKSUP7pimNgvxkSKj+gUQhHpKKACwrin7rS3byU7IxreF56rl5g==", "dev": true, "license": "ISC" }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, "license": "MIT" }, "node_modules/enhanced-resolve": { "version": "5.23.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.23.0.tgz", "integrity": "sha512-yJN/BOOLxcOW2aQgeif9mSnaUB8KtvmMMp56oA1kx1CRfBKbhZm2pJ+NBY+3eOboHxix8lfjWpHE0Ei5U8RbSA==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" }, "engines": { "node": ">=10.13.0" } }, "node_modules/enquirer": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", "dev": true, "license": "MIT", "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8.6" } }, "node_modules/env-paths": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-4.0.0.tgz", "integrity": "sha512-pxP8eL2SwwaTRi/KHYwLYXinDs7gL3jxFcBYmEdYfZmZXbaVDvdppd0XBU8qVz03rDfKZMXg1omHCbsJjZrMsw==", "dev": true, "license": "MIT", "dependencies": { "is-safe-filename": "^0.1.0" }, "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/environment": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz", "integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/es-abstract": { "version": "1.24.2", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.2.tgz", "integrity": "sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==", "dev": true, "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "data-view-buffer": "^1.0.2", "data-view-byte-length": "^1.0.2", "data-view-byte-offset": "^1.0.1", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "es-set-tostringtag": "^2.1.0", "es-to-primitive": "^1.3.0", "function.prototype.name": "^1.1.8", "get-intrinsic": "^1.3.0", "get-proto": "^1.0.1", "get-symbol-description": "^1.1.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "internal-slot": "^1.1.0", "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", "is-weakref": "^1.1.1", "math-intrinsics": "^1.1.0", "object-inspect": "^1.13.4", "object-keys": "^1.1.1", "object.assign": "^4.1.7", "own-keys": "^1.0.1", "regexp.prototype.flags": "^1.5.4", "safe-array-concat": "^1.1.3", "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", "typed-array-buffer": "^1.0.3", "typed-array-byte-length": "^1.0.3", "typed-array-byte-offset": "^1.0.4", "typed-array-length": "^1.0.7", "unbox-primitive": "^1.1.0", "which-typed-array": "^1.1.19" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-errors": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/es-iterator-helpers": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.3.2.tgz", "integrity": "sha512-HVLACW1TppGYjJ8H6/jqH/pqOtKRw6wMlrB23xfExmFWxFquAIWCmwoLsOyN96K4a5KbmOf5At9ZUO3GZbetAw==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.9", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.24.2", "es-errors": "^1.3.0", "es-set-tostringtag": "^2.1.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.3.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "internal-slot": "^1.1.0", "iterator.prototype": "^1.1.5", "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-module-lexer": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.1.0.tgz", "integrity": "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==", "dev": true, "license": "MIT" }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-set-tostringtag": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-to-primitive": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, "license": "MIT", "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", "is-symbol": "^1.0.4" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint": { "version": "9.39.4", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.2", "@eslint/config-helpers": "^0.4.2", "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.5", "@eslint/js": "9.39.4", "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.14.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://eslint.org/donate" }, "peerDependencies": { "jiti": "*" }, "peerDependenciesMeta": { "jiti": { "optional": true } } }, "node_modules/eslint-compat-utils": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", "dev": true, "license": "MIT", "dependencies": { "semver": "^7.5.4" }, "engines": { "node": ">=12" }, "peerDependencies": { "eslint": ">=6.0.0" } }, "node_modules/eslint-config-prettier": { "version": "10.1.8", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, "funding": { "url": "https://opencollective.com/eslint-config-prettier" }, "peerDependencies": { "eslint": ">=7.0.0" } }, "node_modules/eslint-config-webpack": { "version": "4.9.6", "resolved": "https://registry.npmjs.org/eslint-config-webpack/-/eslint-config-webpack-4.9.6.tgz", "integrity": "sha512-4g1VqqOVgPrO/2bh17qNRKsQK26Aw1WF9mVTnvF+rNTDIUUTx+IaukXqXlumzwApQ1GfJlOsdLvT6WER1SPePg==", "dev": true, "license": "MIT", "dependencies": { "@eslint/js": "^9.39.2", "@eslint/markdown": "^8.0.1", "@stylistic/eslint-plugin": "^5.10.0", "detect-indent": "^7.0.2", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", "eslint-plugin-jest": "^29.15.2", "eslint-plugin-jsdoc": "^62.9.0", "eslint-plugin-n": "^18.0.1", "eslint-plugin-prettier": "^5.5.5", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.1.1", "eslint-plugin-unicorn": "^64.0.0", "globals": "^17.6.0", "jsonc-eslint-parser": "^3.1.0", "semver": "^7.8.0", "sort-package-json": "^3.6.0", "typescript-eslint": "^8.59.3" }, "engines": { "node": ">= 20.9.0" }, "peerDependencies": { "eslint": ">= 9.28.0", "typescript": ">=4.8.4 <7.0.0" }, "peerDependenciesMeta": { "typescript": { "optional": true } } }, "node_modules/eslint-config-webpack/node_modules/detect-indent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.2.tgz", "integrity": "sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A==", "dev": true, "license": "MIT", "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint-config-webpack/node_modules/globals": { "version": "17.6.0", "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint-import-resolver-node": { "version": "0.3.10", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.10.tgz", "integrity": "sha512-tRrKqFyCaKict5hOd244sL6EQFNycnMQnBe+j8uqGNXYzsImGbGUU4ibtoaBmv5FLwJwcFJNeg1GeVjQfbMrDQ==", "dev": true, "license": "MIT", "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.16.1", "resolve": "^2.0.0-next.6" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-module-utils": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.13.0.tgz", "integrity": "sha512-bLohSkT6469rRs8czj0tLTD8vaeIS/whvPRJVjDr7IuoTT1k5DYDERlNycjDj/HkOlvQdYurmfZ/g3fG5bgeLQ==", "dev": true, "license": "MIT", "dependencies": { "debug": "^3.2.7" }, "engines": { "node": ">=4" }, "peerDependenciesMeta": { "eslint": { "optional": true } } }, "node_modules/eslint-module-utils/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-plugin-es-x": { "version": "7.8.0", "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz", "integrity": "sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==", "dev": true, "funding": [ "https://github.com/sponsors/ota-meshi", "https://opencollective.com/eslint" ], "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.1.2", "@eslint-community/regexpp": "^4.11.0", "eslint-compat-utils": "^0.5.1" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "peerDependencies": { "eslint": ">=8" } }, "node_modules/eslint-plugin-import": { "version": "2.32.0", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", "dependencies": { "@rtsao/scc": "^1.1.0", "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-import-resolver-node": "^0.3.9", "eslint-module-utils": "^2.12.1", "hasown": "^2.0.2", "is-core-module": "^2.16.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "object.groupby": "^1.0.3", "object.values": "^1.2.1", "semver": "^6.3.1", "string.prototype.trimend": "^1.0.9", "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" }, "peerDependencies": { "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "node_modules/eslint-plugin-import/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "license": "MIT", "dependencies": { "ms": "^2.1.1" } }, "node_modules/eslint-plugin-import/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/eslint-plugin-jest": { "version": "29.15.2", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.15.2.tgz", "integrity": "sha512-kEN4r9RZl1xcsb4arGq89LrcVdOUFII/JSCwtTPJyv16mDwmPrcuEQwpxqZHeINvcsd7oK5O/rhdGlxFRaZwvQ==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/utils": "^8.0.0" }, "engines": { "node": "^20.12.0 || ^22.0.0 || >=24.0.0" }, "peerDependencies": { "@typescript-eslint/eslint-plugin": "^8.0.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "jest": "*", "typescript": ">=4.8.4 <7.0.0" }, "peerDependenciesMeta": { "@typescript-eslint/eslint-plugin": { "optional": true }, "jest": { "optional": true }, "typescript": { "optional": true } } }, "node_modules/eslint-plugin-jsdoc": { "version": "62.9.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-62.9.0.tgz", "integrity": "sha512-PY7/X4jrVgoIDncUmITlUqK546Ltmx/Pd4Hdsu4CvSjryQZJI2mEV4vrdMufyTetMiZ5taNSqvK//BTgVUlNkA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { "@es-joy/jsdoccomment": "~0.86.0", "@es-joy/resolve.exports": "1.2.0", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.6", "debug": "^4.4.3", "escape-string-regexp": "^4.0.0", "espree": "^11.2.0", "esquery": "^1.7.0", "html-entities": "^2.6.0", "object-deep-merge": "^2.0.0", "parse-imports-exports": "^0.2.4", "semver": "^7.7.4", "spdx-expression-parse": "^4.0.0", "to-valid-identifier": "^1.0.0" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" }, "peerDependencies": { "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0" } }, "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "license": "Apache-2.0", "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-plugin-jsdoc/node_modules/espree": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.16.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^5.0.1" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-plugin-n": { "version": "18.1.0", "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.1.0.tgz", "integrity": "sha512-hkUm9EtnFV2h2fE16jNVUfCVUqvPzI7fGLsFdun5lFt/pbmf2kCgDx6ymi9rx+NCUSggBmurJCZOfG20JBs/kg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.5.0", "enhanced-resolve": "^5.17.1", "eslint-plugin-es-x": "^7.8.0", "get-tsconfig": "^4.8.1", "globals": "^15.11.0", "globrex": "^0.1.2", "ignore": "^5.3.2", "semver": "^7.6.3" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" }, "peerDependencies": { "eslint": ">=8.57.1", "ts-declaration-location": "^1.0.6", "typescript": ">=5.0.0" }, "peerDependenciesMeta": { "ts-declaration-location": { "optional": true }, "typescript": { "optional": true } } }, "node_modules/eslint-plugin-n/node_modules/globals": { "version": "15.15.0", "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint-plugin-prettier": { "version": "5.5.6", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.6.tgz", "integrity": "sha512-ifetmTcxWfz+4qRW3pH/ujdTq2jQIj59AxJMIN26K5avYgU8dxycUETQonWiW+wPrYXA0j3Try0l1CnwVQtDqQ==", "dev": true, "license": "MIT", "dependencies": { "prettier-linter-helpers": "^1.0.1", "synckit": "^0.11.13" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", "prettier": ">=3.0.0" }, "peerDependenciesMeta": { "@types/eslint": { "optional": true }, "eslint-config-prettier": { "optional": true } } }, "node_modules/eslint-plugin-react": { "version": "7.37.5", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", "dev": true, "license": "MIT", "dependencies": { "array-includes": "^3.1.8", "array.prototype.findlast": "^1.2.5", "array.prototype.flatmap": "^1.3.3", "array.prototype.tosorted": "^1.1.4", "doctrine": "^2.1.0", "es-iterator-helpers": "^1.2.1", "estraverse": "^5.3.0", "hasown": "^2.0.2", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", "object.entries": "^1.1.9", "object.fromentries": "^2.0.8", "object.values": "^1.2.1", "prop-types": "^15.8.1", "resolve": "^2.0.0-next.5", "semver": "^6.3.1", "string.prototype.matchall": "^4.0.12", "string.prototype.repeat": "^1.0.0" }, "engines": { "node": ">=4" }, "peerDependencies": { "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" } }, "node_modules/eslint-plugin-react-hooks": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.1.1.tgz", "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.24.4", "@babel/parser": "^7.24.4", "hermes-parser": "^0.25.1", "zod": "^3.25.0 || ^4.0.0", "zod-validation-error": "^3.5.0 || ^4.0.0" }, "engines": { "node": ">=18" }, "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0" } }, "node_modules/eslint-plugin-react/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/eslint-plugin-unicorn": { "version": "64.0.0", "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-64.0.0.tgz", "integrity": "sha512-rNZwalHh8i0UfPlhNwg5BTUO1CMdKNmjqe+TgzOTZnpKoi8VBgsW7u9qCHIdpxEzZ1uwrJrPF0uRb7l//K38gA==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "@eslint-community/eslint-utils": "^4.9.1", "change-case": "^5.4.4", "ci-info": "^4.4.0", "clean-regexp": "^1.0.0", "core-js-compat": "^3.49.0", "find-up-simple": "^1.0.1", "globals": "^17.4.0", "indent-string": "^5.0.0", "is-builtin-module": "^5.0.0", "jsesc": "^3.1.0", "pluralize": "^8.0.0", "regexp-tree": "^0.1.27", "regjsparser": "^0.13.0", "semver": "^7.7.4", "strip-indent": "^4.1.1" }, "engines": { "node": "^20.10.0 || >=21.0.0" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" }, "peerDependencies": { "eslint": ">=9.38.0" } }, "node_modules/eslint-plugin-unicorn/node_modules/globals": { "version": "17.6.0", "resolved": "https://registry.npmjs.org/globals/-/globals-17.6.0.tgz", "integrity": "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint-scope": { "version": "8.4.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/eslint/node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "license": "MIT", "dependencies": { "p-locate": "^5.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/p-locate": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", "dependencies": { "p-limit": "^3.0.2" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint/node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/eslint/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, "node_modules/eslint/node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "license": "MIT", "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/espree": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^4.2.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, "license": "BSD-2-Clause", "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" }, "engines": { "node": ">=4" } }, "node_modules/esquery": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dev": true, "license": "BSD-3-Clause", "dependencies": { "estraverse": "^5.1.0" }, "engines": { "node": ">=0.10" } }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" }, "engines": { "node": ">=4.0" } }, "node_modules/estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/eventemitter3": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", "dev": true, "license": "MIT" }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", "dev": true, "license": "MIT", "engines": { "node": ">=0.8.x" } }, "node_modules/extendable-error": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/extendable-error/-/extendable-error-0.1.7.tgz", "integrity": "sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==", "dev": true, "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, "license": "MIT" }, "node_modules/fast-diff": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", "dev": true, "license": "Apache-2.0" }, "node_modules/fast-equals": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-6.0.0.tgz", "integrity": "sha512-PFhhIGgdM79r5Uztdj9Zb6Tt1zKafqVfdMGwVca1z5z6fbX7DmsySSuJd8HiP6I1j505DCS83cLxo5rmSNeVEA==", "dev": true, "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/fast-glob": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" }, "engines": { "node": ">=8.6.0" } }, "node_modules/fast-glob/node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, "engines": { "node": ">= 6" } }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, "license": "MIT" }, "node_modules/fast-uri": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.4.tgz", "integrity": "sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/fastify" }, { "type": "opencollective", "url": "https://opencollective.com/fastify" } ], "license": "BSD-3-Clause" }, "node_modules/fastq": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/fault": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", "dev": true, "license": "MIT", "dependencies": { "format": "^0.2.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dev": true, "license": "MIT", "engines": { "node": ">=12.0.0" }, "peerDependencies": { "picomatch": "^3 || ^4" }, "peerDependenciesMeta": { "picomatch": { "optional": true } } }, "node_modules/file-entry-cache": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { "flat-cache": "^4.0.0" }, "engines": { "node": ">=16.0.0" } }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/find-up": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", "dev": true, "license": "MIT", "dependencies": { "locate-path": "^7.1.0", "path-exists": "^5.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/find-up-simple": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" }, "engines": { "node": ">=16" } }, "node_modules/flatted": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "dev": true, "license": "ISC" }, "node_modules/follow-redirects": { "version": "1.16.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz", "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", "dev": true, "funding": [ { "type": "individual", "url": "https://github.com/sponsors/RubenVerborgh" } ], "license": "MIT", "engines": { "node": ">=4.0" }, "peerDependenciesMeta": { "debug": { "optional": true } } }, "node_modules/for-each": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "dev": true, "license": "MIT", "dependencies": { "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/form-data": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.4", "mime-types": "^2.1.35" }, "engines": { "node": ">= 6" } }, "node_modules/format": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz", "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==", "dev": true, "engines": { "node": ">=0.4.x" } }, "node_modules/fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^4.0.0", "universalify": "^0.1.0" }, "engines": { "node": ">=6 <7 || >=8" } }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true, "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/function.prototype.name": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "functions-have-names": "^1.2.3", "hasown": "^2.0.2", "is-callable": "^1.2.7" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/functions-have-names": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/generator-function": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/gensequence": { "version": "8.0.8", "resolved": "https://registry.npmjs.org/gensequence/-/gensequence-8.0.8.tgz", "integrity": "sha512-omMVniXEXpdx/vKxGnPRoO2394Otlze28TyxECbFVyoSpZ9H3EO7lemjcB12OpQJzRW4e5tt/dL1rOxry6aMHg==", "dev": true, "license": "MIT", "engines": { "node": ">=20" } }, "node_modules/gensync": { "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true, "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-east-asian-width": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/get-intrinsic": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/get-symbol-description": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-tsconfig": { "version": "4.14.0", "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.14.0.tgz", "integrity": "sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==", "dev": true, "license": "MIT", "dependencies": { "resolve-pkg-maps": "^1.0.0" }, "funding": { "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, "node_modules/git-hooks-list": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-4.2.1.tgz", "integrity": "sha512-WNvqJjOxxs/8ZP9+DWdwWJ7cDsd60NHf39XnD82pDVrKO5q7xfPqpkK6hwEAmBa/ZSEE4IOoR75EzbbIuwGlMw==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/fisker/git-hooks-list?sponsor=1" } }, "node_modules/github-slugger": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", "dev": true, "license": "ISC" }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, "engines": { "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, "engines": { "node": ">=10.13.0" } }, "node_modules/glob-to-regex.js": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/glob-to-regex.js/-/glob-to-regex.js-1.2.0.tgz", "integrity": "sha512-QMwlOQKU/IzqMUOAZWubUOT8Qft+Y0KQWnX9nK3ch0CJg0tTp4TvGZsTfudYKv2NzoQSyPcnA6TYeIQ3jGichQ==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/glob-to-regexp": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", "dev": true, "license": "BSD-2-Clause" }, "node_modules/global-directory": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-5.0.0.tgz", "integrity": "sha512-1pgFdhK3J2LeM+dVf2Pd424yHx2ou338lC0ErNP2hPx4j8eW1Sp0XqSjNxtk6Tc4Kr5wlWtSvz8cn2yb7/SG/w==", "dev": true, "license": "MIT", "dependencies": { "ini": "6.0.0" }, "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globals": { "version": "14.0.0", "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globalthis": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, "license": "MIT", "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", "fast-glob": "^3.2.9", "ignore": "^5.2.0", "merge2": "^1.4.1", "slash": "^3.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/globrex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "dev": true, "license": "MIT" }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "license": "ISC" }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, "license": "MIT", "dependencies": { "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-proto": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-tostringtag": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/hasown": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/hermes-estree": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", "dev": true, "license": "MIT" }, "node_modules/hermes-parser": { "version": "0.25.1", "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", "dev": true, "license": "MIT", "dependencies": { "hermes-estree": "0.25.1" } }, "node_modules/html-entities": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.6.0.tgz", "integrity": "sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/mdevils" }, { "type": "patreon", "url": "https://patreon.com/mdevils" } ], "license": "MIT" }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, "license": "MIT", "dependencies": { "agent-base": "6", "debug": "4" }, "engines": { "node": ">= 6" } }, "node_modules/human-id": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/human-id/-/human-id-4.2.0.tgz", "integrity": "sha512-K3GbkIWqyvvlpfhBPlbEvD97TtqBpAYA4kt+cn2lD2x2HuohzZCibcA2nOlnJT6exqvJLggoB5nv2dNf192nEA==", "dev": true, "license": "MIT", "bin": { "human-id": "dist/cli.js" } }, "node_modules/husky": { "version": "9.1.7", "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, "license": "MIT", "bin": { "husky": "bin.js" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" } }, "node_modules/hyperdyperid": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz", "integrity": "sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==", "dev": true, "license": "MIT", "engines": { "node": ">=10.18" } }, "node_modules/iconv-lite": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", "dev": true, "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/express" } }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/import-fresh": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-4.0.0.tgz", "integrity": "sha512-Fpi660c7VPDM3fPKYovStd9IP1CPOikf6v/dGxJJMmHPcwYQIMJ4W7kO1avBYEpMqkCh+Dx3Ln6H7VYqgztLjw==", "dev": true, "license": "MIT", "engines": { "node": ">=22.15" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/import-meta-resolve": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", "dev": true, "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" } }, "node_modules/indent-string": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true, "license": "ISC" }, "node_modules/ini": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz", "integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==", "dev": true, "license": "ISC", "engines": { "node": "^20.17.0 || >=22.9.0" } }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-async-function": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "dev": true, "license": "MIT", "dependencies": { "async-function": "^1.0.0", "call-bound": "^1.0.3", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-bigint": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dev": true, "license": "MIT", "dependencies": { "has-bigints": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-boolean-object": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-builtin-module": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-5.0.0.tgz", "integrity": "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA==", "dev": true, "license": "MIT", "dependencies": { "builtin-modules": "^5.0.0" }, "engines": { "node": ">=18.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-core-module": { "version": "2.16.2", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", "dev": true, "license": "MIT", "dependencies": { "hasown": "^2.0.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-data-view": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-date-object": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/is-finalizationregistry": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-fullwidth-code-point": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz", "integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==", "dev": true, "license": "MIT", "dependencies": { "get-east-asian-width": "^1.3.1" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-generator-function": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.4", "generator-function": "^2.0.0", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, "engines": { "node": ">=0.10.0" } }, "node_modules/is-map": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" } }, "node_modules/is-number-object": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-plain-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-safe-filename": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-safe-filename/-/is-safe-filename-0.1.1.tgz", "integrity": "sha512-4SrR7AdnY11LHfDKTZY1u6Ga3RuxZdl3YKWWShO5iyuG5h8QS4GD2tOb04peBJ5I7pXbR+CGBNEhTcwK+FzN3g==", "dev": true, "license": "MIT", "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-set": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-string": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-subdir": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-subdir/-/is-subdir-1.2.0.tgz", "integrity": "sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==", "dev": true, "license": "MIT", "dependencies": { "better-path-resolve": "1.0.0" }, "engines": { "node": ">=4" } }, "node_modules/is-symbol": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "has-symbols": "^1.1.0", "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-typed-array": { "version": "1.1.15", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dev": true, "license": "MIT", "dependencies": { "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakmap": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakref": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakset": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "dev": true, "license": "MIT" }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, "license": "ISC" }, "node_modules/iterator.prototype": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.6", "get-proto": "^1.0.0", "has-symbols": "^1.1.0", "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, "license": "MIT", "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, "engines": { "node": ">= 10.13.0" } }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true, "license": "MIT" }, "node_modules/js-yaml": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz", "integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/puzrin" }, { "type": "github", "url": "https://github.com/sponsors/nodeca" } ], "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/jsdoc-type-pratt-parser": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-7.2.0.tgz", "integrity": "sha512-dh140MMgjyg3JhJZY/+iEzW+NO5xR2gpbDFKHqotCmexElVntw7GjWjt511+C/Ef02RU5TKYrJo/Xlzk+OLaTw==", "dev": true, "license": "MIT", "engines": { "node": ">=20.0.0" } }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", "dev": true, "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, "engines": { "node": ">=6" } }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, "license": "MIT" }, "node_modules/json-schema-to-typescript": { "version": "15.0.4", "resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-15.0.4.tgz", "integrity": "sha512-Su9oK8DR4xCmDsLlyvadkXzX6+GGXJpbhwoLtOGArAG61dvbW4YQmSEno2y66ahpIdmLMg6YUf/QHLgiwvkrHQ==", "dev": true, "license": "MIT", "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.5.5", "@types/json-schema": "^7.0.15", "@types/lodash": "^4.17.7", "is-glob": "^4.0.3", "js-yaml": "^4.1.0", "lodash": "^4.17.21", "minimist": "^1.2.8", "prettier": "^3.2.5", "tinyglobby": "^0.2.9" }, "bin": { "json2ts": "dist/src/cli.js" }, "engines": { "node": ">=16.0.0" } }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true, "license": "MIT" }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "license": "MIT", "bin": { "json5": "lib/cli.js" }, "engines": { "node": ">=6" } }, "node_modules/jsonc-eslint-parser": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsonc-eslint-parser/-/jsonc-eslint-parser-3.1.0.tgz", "integrity": "sha512-75EA7EWZExL/j+MDKQrRbdzcRI2HOkRlmUw8fZJc1ioqFEOvBsq7Rt+A6yCxOt9w/TYNpkt52gC6nm/g5tFIng==", "dev": true, "license": "MIT", "dependencies": { "acorn": "^8.5.0", "eslint-visitor-keys": "^5.0.0", "semver": "^7.3.5" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://github.com/sponsors/ota-meshi" } }, "node_modules/jsonc-eslint-parser/node_modules/eslint-visitor-keys": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", "dev": true, "license": "Apache-2.0", "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "dev": true, "license": "MIT", "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "node_modules/jsx-ast-utils": { "version": "3.3.5", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", "dev": true, "license": "MIT", "dependencies": { "array-includes": "^3.1.6", "array.prototype.flat": "^1.3.1", "object.assign": "^4.1.4", "object.values": "^1.1.6" }, "engines": { "node": ">=4.0" } }, "node_modules/katex": { "version": "0.16.47", "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz", "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==", "dev": true, "funding": [ "https://opencollective.com/katex", "https://github.com/sponsors/katex" ], "license": "MIT", "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "node_modules/katex/node_modules/commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "dev": true, "license": "MIT", "engines": { "node": ">= 12" } }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } }, "node_modules/levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/lint-staged": { "version": "17.0.8", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.0.8.tgz", "integrity": "sha512-B2P/d+jVW0UXOQ0MVMLrB/9ydA1P+zz6jYfdrbbEd9ur3S2rcbduFWKiUCC02Sm5hbC8nrm7y24WuYMG54HfxA==", "dev": true, "license": "MIT", "dependencies": { "listr2": "^10.2.1", "picomatch": "^4.0.4", "string-argv": "^0.3.2", "tinyexec": "^1.2.4" }, "bin": { "lint-staged": "bin/lint-staged.js" }, "engines": { "node": ">=22.22.1" }, "funding": { "url": "https://opencollective.com/lint-staged" }, "optionalDependencies": { "yaml": "^2.9.0" } }, "node_modules/listr2": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/listr2/-/listr2-10.2.1.tgz", "integrity": "sha512-7I5knELsJKTUjXG+A6BkKAiGkW1i25fNa/xlUl9hFtk15WbE9jndA89xu5FzQKrY5llajE1hfZZFMILXkDHk/Q==", "dev": true, "license": "MIT", "dependencies": { "cli-truncate": "^5.2.0", "eventemitter3": "^5.0.4", "log-update": "^6.1.0", "rfdc": "^1.4.1", "wrap-ansi": "^10.0.0" }, "engines": { "node": ">=22.13.0" } }, "node_modules/loader-runner": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.2.tgz", "integrity": "sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==", "dev": true, "license": "MIT", "engines": { "node": ">=6.11.5" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" } }, "node_modules/locate-path": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", "dev": true, "license": "MIT", "dependencies": { "p-locate": "^6.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", "dev": true, "license": "MIT" }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, "license": "MIT" }, "node_modules/lodash.startcase": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", "integrity": "sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==", "dev": true, "license": "MIT" }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==", "dev": true, "license": "MIT", "dependencies": { "ansi-escapes": "^7.0.0", "cli-cursor": "^5.0.0", "slice-ansi": "^7.1.0", "strip-ansi": "^7.1.0", "wrap-ansi": "^9.0.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/emoji-regex": { "version": "10.6.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", "dev": true, "license": "MIT" }, "node_modules/log-update/node_modules/slice-ansi": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz", "integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==", "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/log-update/node_modules/string-width": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/log-update/node_modules/wrap-ansi": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.2.1", "string-width": "^7.0.0", "strip-ansi": "^7.1.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/longest-streak": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", "dev": true, "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dev": true, "license": "ISC", "dependencies": { "yallist": "^3.0.2" } }, "node_modules/markdown-table": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", "dev": true, "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/mdast-util-find-and-replace": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mdast-util-from-markdown": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "mdast-util-to-string": "^4.0.0", "micromark": "^4.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0", "unist-util-stringify-position": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-frontmatter": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz", "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "escape-string-regexp": "^5.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0", "micromark-extension-frontmatter": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-frontmatter/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/mdast-util-gfm": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", "dev": true, "license": "MIT", "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-gfm-autolink-literal": "^2.0.0", "mdast-util-gfm-footnote": "^2.0.0", "mdast-util-gfm-strikethrough": "^2.0.0", "mdast-util-gfm-table": "^2.0.0", "mdast-util-gfm-task-list-item": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-gfm-autolink-literal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "ccount": "^2.0.0", "devlop": "^1.0.0", "mdast-util-find-and-replace": "^3.0.0", "micromark-util-character": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-gfm-footnote": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.1.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-gfm-strikethrough": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-gfm-table": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "markdown-table": "^3.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-gfm-task-list-item": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-math": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz", "integrity": "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==", "dev": true, "license": "MIT", "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "longest-streak": "^3.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.1.0", "unist-util-remove-position": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-phrasing": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-to-markdown": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "longest-streak": "^3.0.0", "mdast-util-phrasing": "^4.0.0", "mdast-util-to-string": "^4.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "unist-util-visit": "^5.0.0", "zwitch": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/mdast-util-to-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", "dev": true, "license": "MIT", "dependencies": { "@types/mdast": "^4.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/memfs": { "version": "4.57.8", "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.57.8.tgz", "integrity": "sha512-bApYhn8BLpFAnAQmFfEl/NPN+8qx5Ar3V4Qt3ek23mVwBEElzV7c6XoPkb/PCG8ZFpowCEpHcPwMFTwHS7tSMA==", "dev": true, "license": "Apache-2.0", "dependencies": { "@jsonjoy.com/fs-core": "4.57.8", "@jsonjoy.com/fs-fsa": "4.57.8", "@jsonjoy.com/fs-node": "4.57.8", "@jsonjoy.com/fs-node-builtins": "4.57.8", "@jsonjoy.com/fs-node-to-fsa": "4.57.8", "@jsonjoy.com/fs-node-utils": "4.57.8", "@jsonjoy.com/fs-print": "4.57.8", "@jsonjoy.com/fs-snapshot": "4.57.8", "@jsonjoy.com/json-pack": "^1.11.0", "@jsonjoy.com/util": "^1.9.0", "glob-to-regex.js": "^1.0.1", "thingies": "^2.5.0", "tree-dump": "^1.0.3", "tslib": "^2.0.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true, "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/micromark": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-core-commonmark": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-factory-destination": "^2.0.0", "micromark-factory-label": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-factory-title": "^2.0.0", "micromark-factory-whitespace": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-html-tag-name": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-extension-frontmatter": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz", "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==", "dev": true, "license": "MIT", "dependencies": { "fault": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-gfm": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", "dev": true, "license": "MIT", "dependencies": { "micromark-extension-gfm-autolink-literal": "^2.0.0", "micromark-extension-gfm-footnote": "^2.0.0", "micromark-extension-gfm-strikethrough": "^2.0.0", "micromark-extension-gfm-table": "^2.0.0", "micromark-extension-gfm-tagfilter": "^2.0.0", "micromark-extension-gfm-task-list-item": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-gfm-autolink-literal": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", "dev": true, "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-gfm-footnote": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", "dev": true, "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-gfm-strikethrough": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", "dev": true, "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-gfm-table": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", "dev": true, "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-gfm-tagfilter": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", "dev": true, "license": "MIT", "dependencies": { "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-gfm-task-list-item": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", "dev": true, "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-extension-math": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz", "integrity": "sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==", "dev": true, "license": "MIT", "dependencies": { "@types/katex": "^0.16.0", "devlop": "^1.0.0", "katex": "^0.16.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/micromark-factory-destination": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-label": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-space": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-title": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-factory-whitespace": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-character": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-chunked": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-classify-character": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-combine-extensions": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-decode-numeric-character-reference": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-decode-string": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-encode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT" }, "node_modules/micromark-util-html-tag-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT" }, "node_modules/micromark-util-normalize-identifier": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-resolve-all": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-sanitize-uri": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "node_modules/micromark-util-subtokenize": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT", "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "node_modules/micromark-util-symbol": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT" }, "node_modules/micromark-util-types": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", "dev": true, "funding": [ { "type": "GitHub Sponsors", "url": "https://github.com/sponsors/unifiedjs" }, { "type": "OpenCollective", "url": "https://opencollective.com/unified" } ], "license": "MIT" }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { "node": ">=8.6" } }, "node_modules/micromatch/node_modules/picomatch": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { "node": ">=8.6" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "dev": true, "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, "engines": { "node": ">= 0.6" } }, "node_modules/mimic-function": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/minimatch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" }, "engines": { "node": "*" } }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", "dev": true, "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true, "license": "MIT" }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true, "license": "MIT" }, "node_modules/node-exports-info": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/node-exports-info/-/node-exports-info-1.6.0.tgz", "integrity": "sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw==", "dev": true, "license": "MIT", "dependencies": { "array.prototype.flatmap": "^1.3.3", "es-errors": "^1.3.0", "object.entries": "^1.1.9", "semver": "^6.3.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/node-exports-info/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" } }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" }, "engines": { "node": "4.x || >=6.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "peerDependenciesMeta": { "encoding": { "optional": true } } }, "node_modules/node-gyp-build": { "version": "4.8.4", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", "dev": true, "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", "node-gyp-build-test": "build-test.js" } }, "node_modules/node-releases": { "version": "2.0.47", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.47.tgz", "integrity": "sha512-Uzmd6LXpouKo8EUK68IjH4+E01w/hXyV3R3g/geCJo+rXLNfh1xucB+LOzYEOQPSiUK3h/xZf0cQGcSsmyL2Og==", "dev": true, "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/object-deep-merge": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object-deep-merge/-/object-deep-merge-2.0.1.tgz", "integrity": "sha512-aKttDKcU3pyZqKcCkDhsMn70WmZFG2JGDQLP9EcLyTSIFQRCPWLAmBZRLJnrVUrhPG1jETEEbfdgbNtJf1LyMg==", "dev": true, "license": "MIT" }, "node_modules/object-inspect": { "version": "1.13.4", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { "version": "4.1.7", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.entries": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.9.tgz", "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-object-atoms": "^1.1.1" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.groupby": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.values": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/onetime": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz", "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==", "dev": true, "license": "MIT", "dependencies": { "mimic-function": "^5.0.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/optionator": { "version": "0.9.4", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/outdent": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/outdent/-/outdent-0.5.0.tgz", "integrity": "sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==", "dev": true, "license": "MIT" }, "node_modules/own-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", "dev": true, "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.6", "object-keys": "^1.1.1", "safe-push-apply": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/p-filter": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", "integrity": "sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==", "dev": true, "license": "MIT", "dependencies": { "p-map": "^2.0.0" }, "engines": { "node": ">=8" } }, "node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", "dev": true, "license": "MIT", "dependencies": { "yocto-queue": "^1.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", "dev": true, "license": "MIT", "dependencies": { "p-limit": "^4.0.0" }, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/package-manager-detector": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-0.2.11.tgz", "integrity": "sha512-BEnLolu+yuz22S56CU1SUKq3XC3PkwD5wv4ikR4MfGvnRVcmzXR9DwSlW2fEamyTPyXHomBJRzgapeuBvRNzJQ==", "dev": true, "license": "MIT", "dependencies": { "quansync": "^0.2.7" } }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" }, "engines": { "node": ">=6" } }, "node_modules/parse-imports-exports": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz", "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==", "dev": true, "license": "MIT", "dependencies": { "parse-statements": "1.0.11" } }, "node_modules/parse-statements": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz", "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==", "dev": true, "license": "MIT" }, "node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", "dev": true, "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true, "license": "MIT" }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, "license": "ISC" }, "node_modules/picomatch": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/pluralize": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", "dev": true, "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/possible-typed-array-names": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.8.0" } }, "node_modules/prettier": { "version": "3.8.4", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz", "integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==", "dev": true, "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } }, "node_modules/prettier-linter-helpers": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.1.tgz", "integrity": "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==", "dev": true, "license": "MIT", "dependencies": { "fast-diff": "^1.1.2" }, "engines": { "node": ">=6.0.0" } }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "node_modules/proxy-from-env": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", "dev": true, "license": "MIT", "engines": { "node": ">=10" } }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/quansync": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", "integrity": "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==", "dev": true, "funding": [ { "type": "individual", "url": "https://github.com/sponsors/antfu" }, { "type": "individual", "url": "https://github.com/sponsors/sxzz" } ], "license": "MIT" }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ], "license": "MIT" }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true, "license": "MIT" }, "node_modules/read-yaml-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-yaml-file/-/read-yaml-file-1.1.0.tgz", "integrity": "sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==", "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.1.5", "js-yaml": "^3.6.1", "pify": "^4.0.1", "strip-bom": "^3.0.0" }, "engines": { "node": ">=6" } }, "node_modules/read-yaml-file/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "license": "MIT", "dependencies": { "sprintf-js": "~1.0.2" } }, "node_modules/read-yaml-file/node_modules/js-yaml": { "version": "3.14.2", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", "dev": true, "license": "MIT", "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.7", "get-proto": "^1.0.1", "which-builtin-type": "^1.2.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/regexp-tree": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", "dev": true, "license": "MIT", "bin": { "regexp-tree": "bin/regexp-tree" } }, "node_modules/regexp.prototype.flags": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", "get-proto": "^1.0.1", "gopd": "^1.2.0", "set-function-name": "^2.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/regjsparser": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.1.tgz", "integrity": "sha512-dLsljMd9sqwRkby8zhO1gSg3PnJIBFid8f4CQj/sXx+7cKx+E7u0PKhZ+U4wmhx7EfmtvnA318oVaIkAB1lRJw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "jsesc": "~3.1.0" }, "bin": { "regjsparser": "bin/parser" } }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/reserved-identifiers": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/reserved-identifiers/-/reserved-identifiers-1.2.0.tgz", "integrity": "sha512-yE7KUfFvaBFzGPs5H3Ops1RevfUEsDc5Iz65rOwWg4lE8HJSYtle77uul3+573457oHvBKuHYDl/xqUkKpEEdw==", "dev": true, "license": "MIT", "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/resolve": { "version": "2.0.0-next.7", "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.7.tgz", "integrity": "sha512-tqt+NBWwyaMgw3zDsnygx4CByWjQEJHOPMdslYhppaQSJUtL/D4JO9CcBBlhPoI8lz9oJIDXkwXfhF4aWqP8xQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.2", "node-exports-info": "^1.6.0", "object-keys": "^1.1.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, "node_modules/restore-cursor": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz", "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==", "dev": true, "license": "MIT", "dependencies": { "onetime": "^7.0.0", "signal-exit": "^4.1.0" }, "engines": { "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/reusify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" } }, "node_modules/rfdc": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", "dev": true, "license": "MIT" }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, "funding": [ { "type": "github", "url": "https://github.com/sponsors/feross" }, { "type": "patreon", "url": "https://www.patreon.com/feross" }, { "type": "consulting", "url": "https://feross.org/support" } ], "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } }, "node_modules/safe-array-concat": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.4.tgz", "integrity": "sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.9", "call-bound": "^1.0.4", "get-intrinsic": "^1.3.0", "has-symbols": "^1.1.0", "isarray": "^2.0.5" }, "engines": { "node": ">=0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safe-push-apply": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "isarray": "^2.0.5" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safe-regex-test": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-regex": "^1.2.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "license": "MIT" }, "node_modules/schema-utils": { "version": "4.3.3", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", "dev": true, "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.9", "ajv": "^8.9.0", "ajv-formats": "^2.1.1", "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 10.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" } }, "node_modules/schema-utils/node_modules/ajv": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/schema-utils/node_modules/ajv-keywords": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3" }, "peerDependencies": { "ajv": "^8.8.2" } }, "node_modules/schema-utils/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT" }, "node_modules/semver": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.3.tgz", "integrity": "sha512-wnilbGyMxzbY7dNOl7jpKbLSjcfeweJWU5j4+u5qW+6/wuGD9KzIGOyZnQVSBM9E7DtWaaH3CyHkppYrKYoxwg==", "dev": true, "license": "ISC", "bin": { "semver": "bin/semver.js" }, "engines": { "node": ">=10" } }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/set-function-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, "license": "MIT", "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" } }, "node_modules/set-proto": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, "engines": { "node": ">=8" } }, "node_modules/shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/side-channel": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/side-channel-list": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/side-channel-map": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/side-channel-weakmap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", "dev": true, "license": "ISC", "engines": { "node": ">=14" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/slice-ansi": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz", "integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==", "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.2.3", "is-fullwidth-code-point": "^5.1.0" }, "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, "node_modules/smol-toml": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz", "integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">= 18" }, "funding": { "url": "https://github.com/sponsors/cyyynthia" } }, "node_modules/sort-object-keys": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-2.1.0.tgz", "integrity": "sha512-SOiEnthkJKPv2L6ec6HMwhUcN0/lppkeYuN1x63PbyPRrgSPIuBJCiYxYyvWRTtjMlOi14vQUCGUJqS6PLVm8g==", "dev": true, "license": "MIT" }, "node_modules/sort-package-json": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-3.7.1.tgz", "integrity": "sha512-ssk1HG7whF8N/T1IsNAQrtHG5Cbdi0rAgRJZXYBr9hF5xaHnBNzUx/W6LcthEW7FhOwvZssbESZuO+GxssqAyA==", "dev": true, "license": "MIT", "dependencies": { "detect-indent": "^7.0.2", "detect-newline": "^4.0.1", "git-hooks-list": "^4.1.1", "is-plain-obj": "^4.1.0", "semver": "^7.7.3", "sort-object-keys": "^2.0.1", "tinyglobby": "^0.2.15" }, "bin": { "sort-package-json": "cli.js" }, "engines": { "node": ">=20" } }, "node_modules/sort-package-json/node_modules/detect-indent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.2.tgz", "integrity": "sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A==", "dev": true, "license": "MIT", "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/source-map-support": { "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "node_modules/spawndamnit": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spawndamnit/-/spawndamnit-3.0.1.tgz", "integrity": "sha512-MmnduQUuHCoFckZoWnXsTg7JaiLBJrKFj9UI2MbRPGaJeVpsLcVBu6P/IGZovziM/YBsellCmsprgNA+w0CzVg==", "dev": true, "license": "SEE LICENSE IN LICENSE", "dependencies": { "cross-spawn": "^7.0.5", "signal-exit": "^4.0.1" } }, "node_modules/spdx-exceptions": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true, "license": "CC-BY-3.0" }, "node_modules/spdx-expression-parse": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", "dev": true, "license": "MIT", "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" } }, "node_modules/spdx-license-ids": { "version": "3.0.23", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.23.tgz", "integrity": "sha512-CWLcCCH7VLu13TgOH+r8p1O/Znwhqv/dbb6lqWy67G+pT1kHmeD/+V36AVb/vq8QMIQwVShJ6Ssl5FPh0fuSdw==", "dev": true, "license": "CC0-1.0" }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/stack-trace": { "version": "1.0.0-pre2", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-1.0.0-pre2.tgz", "integrity": "sha512-2ztBJRek8IVofG9DBJqdy2N5kulaacX30Nz7xmkYF6ale9WBVmIy6mFBchvGX7Vx/MyjBhx+Rcxqrj+dbOnQ6A==", "dev": true, "license": "MIT", "engines": { "node": ">=16" } }, "node_modules/stop-iteration-iterator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", "internal-slot": "^1.1.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", "dev": true, "license": "MIT", "engines": { "node": ">=0.6.19" } }, "node_modules/string-width": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz", "integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==", "dev": true, "license": "MIT", "dependencies": { "get-east-asian-width": "^1.5.0", "strip-ansi": "^7.1.2" }, "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/string-width/node_modules/strip-ansi": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/string.prototype.matchall": { "version": "4.0.12", "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-abstract": "^1.23.6", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.6", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "internal-slot": "^1.1.0", "regexp.prototype.flags": "^1.5.3", "set-function-name": "^2.0.2", "side-channel": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.repeat": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", "dev": true, "license": "MIT", "dependencies": { "define-properties": "^1.1.3", "es-abstract": "^1.17.5" } }, "node_modules/string.prototype.trim": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.11.tgz", "integrity": "sha512-PwvK7BU+CMTJGYQCTZb5RWXIML92lftJLhQz1tBzgKiqGxJaMlBAa48POXaNAC2s4y8jr3EFqrkF9+44neS46w==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.9", "call-bound": "^1.0.4", "define-data-property": "^1.1.4", "define-properties": "^1.2.1", "es-abstract": "^1.24.2", "es-object-atoms": "^1.1.2", "has-property-descriptors": "^1.0.2", "safe-regex-test": "^1.1.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimend": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.10.tgz", "integrity": "sha512-2+3aDAOmPTmuFwjDnmJG2ctEkQKVki7vOSqaxkv42Mowj1V6PnvuwFCRrR5lChUux1TBskPjfkeTOhqczDMxTw==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.9", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-object-atoms": "^1.1.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, "engines": { "node": ">=8" } }, "node_modules/strip-ansi/node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/strip-indent": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-4.1.1.tgz", "integrity": "sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/synckit": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.13.tgz", "integrity": "sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==", "dev": true, "license": "MIT", "dependencies": { "@pkgr/core": "^0.3.6" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/synckit" } }, "node_modules/tapable": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", "license": "MIT", "engines": { "node": ">=6" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" } }, "node_modules/term-size": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", "dev": true, "license": "MIT", "engines": { "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/terser": { "version": "5.48.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.48.0.tgz", "integrity": "sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" }, "engines": { "node": ">=10" } }, "node_modules/terser-webpack-plugin": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.6.1.tgz", "integrity": "sha512-201R5j+sJpK8nFWwKVyNfZot8FaJbLZDq5evriVzbV1wDtSXDjRUDRfJzHpAaxFDMEhsZL1QkeqM61wgsS3KaQ==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "^0.3.25", "jest-worker": "^27.4.5", "schema-utils": "^4.3.0", "terser": "^5.31.1" }, "engines": { "node": ">= 10.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependencies": { "webpack": "^5.1.0" }, "peerDependenciesMeta": { "@minify-html/node": { "optional": true }, "@swc/core": { "optional": true }, "@swc/css": { "optional": true }, "@swc/html": { "optional": true }, "clean-css": { "optional": true }, "cssnano": { "optional": true }, "csso": { "optional": true }, "esbuild": { "optional": true }, "html-minifier-terser": { "optional": true }, "lightningcss": { "optional": true }, "postcss": { "optional": true }, "uglify-js": { "optional": true } } }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "license": "MIT" }, "node_modules/thingies": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/thingies/-/thingies-2.6.0.tgz", "integrity": "sha512-rMHRjmlFLM1R96UYPvpmnc3LYtdFrT33JIB7L9hetGue1qAPfn1N2LJeEjxUSidu1Iku+haLZXDuEXUHNGO/lg==", "dev": true, "license": "MIT", "engines": { "node": ">=10.18" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "^2" } }, "node_modules/tinybench": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.0.2.tgz", "integrity": "sha512-FlHoQpcFvCzeXK5kVPvV7IVgW/hs/B36QWTz876iSdeJguBDfdTSRQmYmaHX+fQNt4hp+gEFB2XXw+8hT4/y8A==", "dev": true, "license": "MIT", "engines": { "node": ">=20.0.0" } }, "node_modules/tinyexec": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", "dev": true, "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "license": "MIT", "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" }, "engines": { "node": ">=12.0.0" }, "funding": { "url": "https://github.com/sponsors/SuperchupuDev" } }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, "engines": { "node": ">=8.0" } }, "node_modules/to-valid-identifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-valid-identifier/-/to-valid-identifier-1.0.0.tgz", "integrity": "sha512-41wJyvKep3yT2tyPqX/4blcfybknGB4D+oETKLs7Q76UiPqRpUJK3hr1nxelyYO0PHKVzJwlu0aCeEAsGI6rpw==", "dev": true, "license": "MIT", "dependencies": { "@sindresorhus/base62": "^1.0.0", "reserved-identifiers": "^1.0.0" }, "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/tooling": { "version": "1.26.4", "resolved": "git+ssh://git@github.com/webpack/tooling.git#978dc1c9680ef7d79f5f5c02c3439385d7937c39", "integrity": "sha512-ay+Gy5P4J6Kw5Bowy6j6Ssg0TI8QdiDPs2mrzDrgXrl8VFMphxZ/xcac3RWYC781g50s99Yoa/1ELmDkNdG8RQ==", "dev": true, "license": "MIT", "dependencies": { "@yarnpkg/lockfile": "^1.1.0", "ajv": "^8.1.0", "commondir": "^1.0.1", "glob": "^7.1.6", "json-schema-to-typescript": "^15.0.4", "terser": "^5.32.0", "yargs": "^16.1.1" }, "peerDependencies": { "prettier": "*", "typescript": "*" } }, "node_modules/tooling/node_modules/ajv": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" }, "funding": { "type": "github", "url": "https://github.com/sponsors/epoberezkin" } }, "node_modules/tooling/node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, "license": "MIT" }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "dev": true, "license": "MIT" }, "node_modules/tree-dump": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.1.0.tgz", "integrity": "sha512-rMuvhU4MCDbcbnleZTFezWsaZXRFemSqAM+7jPnzUl1fo9w3YEKOxAeui0fz3OI4EU4hf23iyA7uQRVko+UaBA==", "dev": true, "license": "Apache-2.0", "engines": { "node": ">=10.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" }, "peerDependencies": { "tslib": "2" } }, "node_modules/ts-api-utils": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", "dev": true, "license": "MIT", "engines": { "node": ">=18.12" }, "peerDependencies": { "typescript": ">=4.8.4" } }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, "license": "MIT", "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "node_modules/tsconfig-paths/node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "license": "MIT", "dependencies": { "minimist": "^1.2.0" }, "bin": { "json5": "lib/cli.js" } }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "dev": true, "license": "0BSD" }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", "dependencies": { "prelude-ls": "^1.2.1" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" } }, "node_modules/typed-array-byte-length": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typed-array-byte-offset": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.15", "reflect.getprototypeof": "^1.0.9" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typed-array-length": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.8.tgz", "integrity": "sha512-phPGCwqr2+Qo0fwniCE8e4pKnGu/yFb5nD5Y8bf0EEeiI5GklnACYA9GFy/DrAeRrKHXvHn+1SUsOWgJp6RO+g==", "dev": true, "license": "MIT", "dependencies": { "call-bind": "^1.0.9", "for-each": "^0.3.5", "gopd": "^1.2.0", "is-typed-array": "^1.1.15", "possible-typed-array-names": "^1.1.0", "reflect.getprototypeof": "^1.0.10" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/typescript": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { "node": ">=14.17" } }, "node_modules/typescript-eslint": { "version": "8.61.0", "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.61.0.tgz", "integrity": "sha512-8y31Rd0eGTrDKqhy6vT0HtzhN+YLjQizwX3aA3hPXP/ynSfnrBXcQY5IzsP9/DM7+klX4IUncZZjkchP0z+rUw==", "dev": true, "license": "MIT", "dependencies": { "@typescript-eslint/eslint-plugin": "8.61.0", "@typescript-eslint/parser": "8.61.0", "@typescript-eslint/typescript-estree": "8.61.0", "@typescript-eslint/utils": "8.61.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/unbox-primitive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", "has-symbols": "^1.1.0", "which-boxed-primitive": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/undici-types": { "version": "7.18.2", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", "dev": true, "license": "MIT" }, "node_modules/unist-util-is": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-remove-position": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", "unist-util-visit": "^5.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-stringify-position": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-visit": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/unist-util-visit-parents": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", "dev": true, "license": "MIT", "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, "node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true, "license": "MIT", "engines": { "node": ">= 4.0.0" } }, "node_modules/update-browserslist-db": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "dev": true, "funding": [ { "type": "opencollective", "url": "https://opencollective.com/browserslist" }, { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" }, { "type": "github", "url": "https://github.com/sponsors/ai" } ], "license": "MIT", "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "bin": { "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" } }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", "dev": true, "license": "MIT" }, "node_modules/vscode-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.1.0.tgz", "integrity": "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==", "dev": true, "license": "MIT" }, "node_modules/watchpack": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.1.tgz", "integrity": "sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg==", "dev": true, "license": "MIT", "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" }, "engines": { "node": ">=10.13.0" } }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "dev": true, "license": "BSD-2-Clause" }, "node_modules/webpack": { "version": "5.107.2", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.107.2.tgz", "integrity": "sha512-v7RhXaJbpMlV0D7hC7lb2EbnxkoeUqf9qhKr6lozx3Q48pmFrqqNRmZFUEGmi7pSwm6fCQ2H1IjvCkHqdpVdjQ==", "dev": true, "license": "MIT", "dependencies": { "@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.16.0", "acorn-import-phases": "^1.0.3", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.22.0", "es-module-lexer": "^2.1.0", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.11", "loader-runner": "^4.3.2", "mime-db": "^1.54.0", "neo-async": "^2.6.2", "schema-utils": "^4.3.3", "tapable": "^2.3.0", "terser-webpack-plugin": "^5.5.0", "watchpack": "^2.5.1", "webpack-sources": "^3.5.0" }, "bin": { "webpack": "bin/webpack.js" }, "engines": { "node": ">=10.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" }, "peerDependenciesMeta": { "webpack-cli": { "optional": true } } }, "node_modules/webpack-sources": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.5.0.tgz", "integrity": "sha512-HPuy+uuoTCaaoEoI1LQ3JN9+vrPBvEesnnX1jADHy728cHSMlq4wUc4afYqahq2B1mhQVZxCXOkNTnXltr+2vQ==", "dev": true, "license": "MIT", "engines": { "node": ">=10.13.0" } }, "node_modules/webpack/node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" }, "engines": { "node": ">=8.0.0" } }, "node_modules/webpack/node_modules/estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" } }, "node_modules/webpack/node_modules/mime-db": { "version": "1.54.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "dev": true, "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "dev": true, "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "bin/node-which" }, "engines": { "node": ">= 8" } }, "node_modules/which-boxed-primitive": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "dev": true, "license": "MIT", "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", "is-number-object": "^1.1.1", "is-string": "^1.1.1", "is-symbol": "^1.1.1" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-builtin-type": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", "dev": true, "license": "MIT", "dependencies": { "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", "has-tostringtag": "^1.0.2", "is-async-function": "^2.0.0", "is-date-object": "^1.1.0", "is-finalizationregistry": "^1.1.0", "is-generator-function": "^1.0.10", "is-regex": "^1.2.1", "is-weakref": "^1.0.2", "isarray": "^2.0.5", "which-boxed-primitive": "^1.1.0", "which-collection": "^1.0.2", "which-typed-array": "^1.1.16" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-collection": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dev": true, "license": "MIT", "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", "is-weakmap": "^2.0.2", "is-weakset": "^2.0.3" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/which-typed-array": { "version": "1.1.22", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.22.tgz", "integrity": "sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==", "dev": true, "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.9", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/wrap-ansi": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-10.0.0.tgz", "integrity": "sha512-SGcvg80f0wUy2/fXES19feHMz8E0JoXv2uNgHOu4Dgi2OrCy1lqwFYEJz1BLbDI0exjPMe/ZdzZ/YpGECBG/aQ==", "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^6.2.3", "string-width": "^8.2.0", "strip-ansi": "^7.1.2" }, "engines": { "node": ">=20" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/strip-ansi": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true, "license": "ISC" }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", "integrity": "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==", "dev": true, "license": "MIT", "engines": { "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true, "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, "license": "ISC" }, "node_modules/yaml": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { "node": ">= 14.6" }, "funding": { "url": "https://github.com/sponsors/eemeli" } }, "node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" }, "engines": { "node": ">=10" } }, "node_modules/yargs-parser": { "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "dev": true, "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yargs/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/yargs/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, "node_modules/yocto-queue": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz", "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", "dev": true, "license": "MIT", "engines": { "node": ">=12.20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/zod": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zod-validation-error": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" } }, "node_modules/zwitch": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", "dev": true, "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } } } } webpack-enhanced-resolve-7dfc9bc/package.json000066400000000000000000000065231523262174200214310ustar00rootroot00000000000000{ "name": "enhanced-resolve", "version": "5.24.5", "description": "Offers a async require.resolve function. It's highly configurable.", "homepage": "https://github.com/webpack/enhanced-resolve#readme", "repository": { "type": "git", "url": "git+https://github.com/webpack/enhanced-resolve.git" }, "license": "MIT", "author": "Tobias Koppers @sokra", "main": "lib/index.js", "browser": { "process": "./lib/util/process-browser.js", "module": "./lib/util/module-browser.js", "path": "./lib/util/path-browser.js", "url": "./lib/util/url-browser.js", "graceful-fs": "./lib/util/graceful-fs-browser.js" }, "types": "types.d.ts", "files": [ "lib", "types.d.ts", "LICENSE" ], "scripts": { "prepare": "husky", "lint": "npm run lint:code && npm run lint:types && npm run lint:types-test && npm run lint:special && npm run fmt:check && npm run lint:spellcheck", "lint:code": "eslint --cache .", "lint:special": "node node_modules/tooling/inherit-types && node node_modules/tooling/generate-types", "lint:types": "tsc", "lint:types-test": "tsc -p tsconfig.types.test.json", "lint:spellcheck": "cspell --cache --no-must-find-files --quiet \"**/*.*\"", "fmt": "npm run fmt:base -- --log-level warn --write", "fmt:check": "npm run fmt:base -- --check", "fmt:base": "node_modules/prettier/bin/prettier.cjs --cache --ignore-unknown .", "fix": "npm run fix:code && npm run fix:special", "fix:code": "npm run lint:code -- --fix", "fix:special": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/generate-types --write", "type-report": "rimraf coverage && npm run cover:types && npm run cover:report && open-cli coverage/lcov-report/index.html", "pretest": "npm run lint", "test": "npm run test:only", "test:only": "node scripts/test.js", "test:watch": "node scripts/test.js --watch", "test:coverage": "node scripts/test.js --experimental-test-coverage --test-coverage-include=\"lib/**\" --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage/lcov.info", "test:browser": "node --experimental-vm-modules test/smoke/browser-run.cjs", "version": "changeset version", "release": "changeset publish", "benchmark": "node --max-old-space-size=4096 --hash-seed=1 --random-seed=1 --no-opt --predictable --predictable-gc-schedule --interpreted-frames-native-stack --allow-natives-syntax --expose-gc --no-concurrent-sweeping ./benchmark/run.mjs" }, "lint-staged": { "*.{js,cjs,mjs}": [ "eslint --cache --fix" ], "*": [ "prettier --cache --write --ignore-unknown", "cspell --cache --no-must-find-files" ] }, "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" }, "devDependencies": { "@changesets/cli": "^2.30.0", "@changesets/get-github-info": "^0.8.0", "@codspeed/core": "^5.2.0", "@types/graceful-fs": "^4.1.6", "@types/node": "^24.10.4", "cspell": "^10.0.0", "eslint": "^9.39.2", "eslint-config-webpack": "^4.9.5", "husky": "^9.1.7", "lint-staged": "^17.0.4", "memfs": "^4.56.11", "prettier": "^3.7.4", "tinybench": "^6.0.0", "tooling": "webpack/tooling#v1.26.4", "typescript": "^6.0.2", "webpack": "^5.107.2" }, "engines": { "node": ">=10.13.0" } } webpack-enhanced-resolve-7dfc9bc/scripts/000077500000000000000000000000001523262174200206245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/scripts/test.js000066400000000000000000000023421523262174200221420ustar00rootroot00000000000000"use strict"; // Runs the test suite with the Node.js built-in test runner. // // The files are enumerated explicitly instead of relying on `node --test` // auto-discovery: the default discovery pattern treats every `.js` file under // a `test/` directory as a test (including everything in `test/fixtures`), and // native glob support in `node --test` is only available on newer Node.js // versions. Passing an explicit list keeps behavior identical across the whole // supported Node.js range and on every OS. const { spawn } = require("child_process"); const { mkdirSync, readdirSync } = require("fs"); const path = require("path"); const testDir = path.join(__dirname, "..", "test"); const files = readdirSync(testDir) .filter((file) => file.endsWith(".test.js")) .sort() .map((file) => path.join("test", file)); const nodeArgs = process.argv.slice(2); if (nodeArgs.includes("--experimental-test-coverage")) { mkdirSync(path.join(__dirname, "..", "coverage"), { recursive: true }); } const child = spawn(process.execPath, ["--test", ...nodeArgs, ...files], { stdio: "inherit", }); child.on("exit", (code, signal) => { if (signal) { process.kill(process.pid, signal); } else { process.exitCode = code === null ? 1 : code; } }); webpack-enhanced-resolve-7dfc9bc/test/000077500000000000000000000000001523262174200201145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/CachedInputFileSystem.test.js000066400000000000000000000513571523262174200256370ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const path = require("path"); const url = require("url"); const { CachedInputFileSystem } = require("../"); const { afterEach, beforeEach, describe, it } = require("./_runner"); describe("cachedInputFileSystem OperationMergerBackend ('stat' and 'statSync')", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem( { stat(path, options, callback) { if (!callback) { callback = options; options = undefined; } setTimeout( () => callback(null, { path, options, }), 100, ); }, // @ts-expect-error for tests statSync(path, options) { return { path, options, }; }, }, 0, ); }); afterEach(() => { fs.purge(); }); it("should join accesses", (t, done) => { fs.stat("a", (err, result) => { assert.notStrictEqual(result, undefined); result.a = true; }); fs.stat("a", (err, result) => { assert.notStrictEqual(result, undefined); assert.notStrictEqual(result.a, undefined); done(); }); }); it("should not join accesses with options", (t, done) => { fs.stat("a", (err, result) => { assert.notStrictEqual(result, undefined); result.a = true; assert.strictEqual(result.path, "a"); assert.strictEqual(result.options, undefined); }); fs.stat("a", { options: true }, (err, result) => { assert.notStrictEqual(result, undefined); assert.strictEqual(result.a, undefined); assert.strictEqual(result.path, "a"); assert.strictEqual(result.options.options, true); done(); }); }); it("should not cache accesses", (t, done) => { fs.stat("a", (err, result) => { result.a = true; fs.stat("a", (err, result) => { assert.strictEqual(result.a, undefined); done(); }); }); }); it("should not cache sync accesses", () => { const result = fs.statSync("a"); result.a = true; const result2 = fs.statSync("a"); assert.strictEqual(result2.a, undefined); }); }); describe("cachedInputFileSystem OperationMergerBackend ('lstat' and 'lstatSync')", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem( { lstat(path, options, callback) { if (!callback) { callback = options; options = undefined; } setTimeout( () => callback(null, { path, options, }), 100, ); }, // @ts-expect-error for tests lstatSync(path, options) { return { path, options, }; }, }, 0, ); }); afterEach(() => { fs.purge(); }); it("should join accesses", (t, done) => { fs.lstat("a", (err, result) => { assert.notStrictEqual(result, undefined); result.a = true; }); fs.lstat("a", (err, result) => { assert.notStrictEqual(result, undefined); assert.notStrictEqual(result.a, undefined); done(); }); }); it("should not join accesses with options", (t, done) => { fs.lstat("a", (err, result) => { assert.notStrictEqual(result, undefined); result.a = true; assert.notStrictEqual(result, undefined); assert.strictEqual(result.path, "a"); assert.strictEqual(result.options, undefined); }); fs.lstat("a", { options: true }, (err, result) => { assert.notStrictEqual(result, undefined); assert.strictEqual(result.a, undefined); assert.strictEqual(result.path, "a"); assert.strictEqual(result.options.options, true); done(); }); }); it("should not cache accesses", (t, done) => { fs.lstat("a", (err, result) => { result.a = true; fs.lstat("a", (err, result) => { assert.strictEqual(result.a, undefined); done(); }); }); }); it("should not cache sync accesses", () => { const result = fs.lstatSync("a"); result.a = true; const result2 = fs.lstatSync("a"); assert.strictEqual(result2.a, undefined); }); }); describe("cachedInputFileSystem OperationMergerBackend ('realpath' and 'realpathSync')", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem( { realpath(path, options, callback) { if (!callback) { callback = options; options = undefined; } setTimeout( () => callback(null, { path, options, }), 100, ); }, // @ts-expect-error for tests realpathSync(path, options) { return { path, options, }; }, }, 0, ); }); afterEach(() => { fs.purge(); }); it("should join accesses", (t, done) => { fs.realpath("a", (err, result) => { assert.notStrictEqual(result, undefined); result.a = true; }); fs.realpath("a", (err, result) => { assert.notStrictEqual(result, undefined); assert.notStrictEqual(result.a, undefined); done(); }); }); it("should not join accesses with options", (t, done) => { fs.realpath("a", (err, result) => { assert.notStrictEqual(result, undefined); result.a = true; assert.notStrictEqual(result, undefined); assert.strictEqual(result.path, "a"); assert.strictEqual(result.options, undefined); }); fs.realpath("a", { options: true }, (err, result) => { assert.notStrictEqual(result, undefined); assert.strictEqual(result.a, undefined); assert.strictEqual(result.path, "a"); assert.strictEqual(result.options.options, true); done(); }); }); it("should not cache accesses", (t, done) => { fs.realpath("a", (err, result) => { result.a = true; fs.realpath("a", (err, result) => { assert.strictEqual(result.a, undefined); done(); }); }); }); it("should not cache sync accesses", () => { const result = fs.realpathSync("a"); result.a = true; const result2 = fs.realpathSync("a"); assert.strictEqual(result2.a, undefined); }); }); describe("cachedInputFileSystem CacheBackend", () => { let fs; beforeEach(() => { let counter = 0; fs = new CachedInputFileSystem( { stat(path, options, callback) { if (!callback) { callback = options; options = undefined; } setTimeout( callback.bind(null, null, { path, options, }), 100, ); }, // @ts-expect-error for tests statSync(path, options) { return { path, options, }; }, readdir(path, callback) { callback(null, [`${counter++}`]); }, }, 1000, ); }); afterEach(() => { fs.purge(); }); it("should join accesses", (t, done) => { fs.stat("a", (err, result) => { result.a = true; }); fs.stat("a", (err, result) => { assert.notStrictEqual(result.a, undefined); done(); }); }); it("should not call callback twice when combining sync and async calls", (t, done) => { let called = false; fs.stat("a", (err, result) => { if (called) return done(new Error("callback was called twice")); called = true; assert.notStrictEqual(result, undefined); result.a = true; done(); }); const syncResult = fs.statSync("a"); assert.notStrictEqual(syncResult, undefined); assert.notStrictEqual(syncResult.a, undefined); }); it("should not join accesses with options", (t, done) => { fs.stat("a", (err, result) => { result.a = true; assert.strictEqual(result.path, "a"); assert.strictEqual(result.options, undefined); }); fs.stat("a", { options: true }, (err, result) => { assert.strictEqual(result.a, undefined); assert.strictEqual(result.path, "a"); assert.strictEqual(result.options.options, true); done(); }); }); it("should cache accesses", (t, done) => { fs.stat("a", (err, result) => { result.a = true; let sync = true; fs.stat("a", (err, result) => { assert.notStrictEqual(result.a, undefined); assert.strictEqual(sync, true); setTimeout(() => { fs.stat("a", (err, result) => { assert.strictEqual(result.a, undefined); result.b = true; let sync2 = true; fs.stat("a", (err, result) => { assert.notStrictEqual(result.b, undefined); assert.strictEqual(result.a, undefined); assert.strictEqual(sync2, true); done(); }); setTimeout(() => { sync2 = false; }, 50); }); }, 1100); }); setTimeout(() => { sync = false; }, 50); }); }); it("should cache sync accesses", () => { const result = fs.statSync("a"); result.a = true; const result2 = fs.statSync("a"); assert.notStrictEqual(result2.a, undefined); const result3 = fs.statSync("a", { options: true }); assert.strictEqual(result3.a, undefined); assert.strictEqual(result3.options.options, true); }); it("should recover after passive periods", (t, done) => { fs.stat("a", (err, result) => { result.a = true; setTimeout(() => { fs.stat("a", (err, result) => { assert.notStrictEqual(result.a, undefined); setTimeout(() => { fs.stat("a", (err, result) => { assert.strictEqual(result.a, undefined); result.b = true; setTimeout(() => { fs.stat("a", (err, result) => { assert.notStrictEqual(result.b, undefined); assert.strictEqual(result.a, undefined); done(); }); }, 500); }); }, 600); }); }, 500); }); }); it("should restart after timeout", (t, done) => { fs.stat("a", (err, result) => { result.a = true; setTimeout(() => { fs.stat("a", (err, result) => { assert.strictEqual(result.a, undefined); result.b = true; setTimeout(() => { fs.stat("a", (err, result) => { assert.notStrictEqual(result.b, undefined); assert.strictEqual(result.a, undefined); done(); }); }, 50); }); }, 1100); }); }); it("should call cached callbacks asynchronously and in order", (t, done) => { fs.stat("a", () => { // cache for "a" is now populated; a burst of cached calls must // stay asynchronous and preserve issue order /** @type {number[]} */ const order = []; let sync = true; fs.stat("a", () => order.push(1)); fs.stat("a", () => order.push(2)); fs.stat("a", () => { order.push(3); assert.strictEqual(sync, false); assert.deepStrictEqual(order, [1, 2, 3]); done(); }); assert.deepStrictEqual(order, []); sync = false; }); }); it("should deliver a giant burst of cached calls exactly once each", (t, done) => { fs.stat("a", () => { // 600 hits spill ~1800 queue elements, exercising the retained // capacity cap after the drain const total = 600; let called = 0; /** @type {boolean[]} */ const delivered = Array.from({ length: total }, () => false); /** * @param {number} index index * @returns {(err: Error | null, result: unknown) => void} callback */ const makeCallback = (index) => (err, result) => { assert.strictEqual(err, null); assert.notStrictEqual(result, undefined); // a duplicate delivery for this request fails here assert.strictEqual(delivered[index], false); delivered[index] = true; called++; if (called === total) done(); }; for (let i = 0; i < total; i++) fs.stat("a", makeCallback(i)); }); }); it("should stay asynchronous for cached calls made from a cached callback", (t, done) => { fs.stat("a", () => { fs.stat("a", () => { let sync = true; fs.stat("a", () => { assert.strictEqual(sync, false); done(); }); sync = false; }); }); }); it("should cache undefined value", (t, done) => { fs.stat(undefined, (_err, result) => { assert.strictEqual(result, undefined); fs.purge("a"); fs.purge(); done(); }); }); it("should purge readdir correctly", (t, done) => { fs.readdir("/test/path", (err, r) => { assert.strictEqual(r[0], "0"); fs.purge(["/test/path/sub/path"]); fs.readdir("/test/path", (err, r) => { assert.strictEqual(r[0], "0"); fs.purge(["/test/path/sub"]); fs.readdir("/test/path", (err, r) => { assert.strictEqual(r[0], "1"); fs.purge(["/test/path"]); fs.readdir("/test/path", (err, r) => { assert.strictEqual(r[0], "2"); fs.purge([url.pathToFileURL("/test/path")]); fs.readdir("/test/path", (err, r) => { assert.strictEqual(r[0], "2"); fs.purge(Buffer.from("/test/path")); fs.readdir("/test/path", (err, r) => { assert.strictEqual(r[0], "3"); fs.purge([Buffer.from("/test/path")]); fs.readdir("/test/path", (err, r) => { assert.strictEqual(r[0], "4"); done(); }); }); }); }); }); }); }); }); it("should not clear the entire cache when purging falsy keys 0 or ''", (t, done) => { // number 0 (a valid fd) and "" are valid cache keys per the signature; // passing them must not be confused with the no-arg "clear all" form. fs.stat("/test/path", (err, r1) => { r1.cached = true; fs.purge(0); fs.stat("/test/path", (err, r2) => { assert.strictEqual(r2.cached, true); fs.purge(""); fs.stat("/test/path", (err, r3) => { // Empty string is a prefix of every key, so prefix-purge still clears // everything — but only because of the prefix semantics, not because // "" was misclassified as "no argument". assert.strictEqual(r3.cached, undefined); done(); }); }); }); }); it("should not crash when options is null", (t, done) => { fs.stat("/test/path", (err, r1) => { r1.cached = true; assert.doesNotThrow(() => fs.purge("/test/path", null)); fs.stat("/test/path", (err, r2) => { // null is treated as "no options" — falls back to prefix purge assert.strictEqual(r2.cached, undefined); done(); }); }); }); it("should purge exact entries only when exact: true", (t, done) => { fs.stat("/test/path", (err, r1) => { assert.strictEqual(r1.path, "/test/path"); r1.cached = true; fs.stat("/test/path/sub", (err, r2) => { assert.strictEqual(r2.path, "/test/path/sub"); r2.cached = true; // Prefix purge with exact: true should NOT remove the child entry fs.purge("/test/path", { exact: true }); fs.stat("/test/path", (err, r3) => { // /test/path was the exact match, should be re-fetched (cached flag gone) assert.strictEqual(r3.cached, undefined); fs.stat("/test/path/sub", (err, r4) => { // /test/path/sub should still be cached assert.strictEqual(r4.cached, true); done(); }); }); }); }); }); it("should purge an array exactly when exact: true", (t, done) => { fs.stat("/test/path", (err, r1) => { r1.cached = true; fs.stat("/test/path/sub", (err, r2) => { r2.cached = true; fs.stat("/other", (err, r3) => { r3.cached = true; fs.purge(["/test/path", "/other"], { exact: true }); fs.stat("/test/path", (err, r4) => { assert.strictEqual(r4.cached, undefined); fs.stat("/test/path/sub", (err, r5) => { assert.strictEqual(r5.cached, true); fs.stat("/other", (err, r6) => { assert.strictEqual(r6.cached, undefined); done(); }); }); }); }); }); }); }); it("should still prefix-purge when exact is not set or false", (t, done) => { fs.stat("/test/path", (err, r1) => { r1.cached = true; fs.stat("/test/path/sub", (err, r2) => { r2.cached = true; fs.purge("/test/path"); fs.stat("/test/path", (err, r3) => { assert.strictEqual(r3.cached, undefined); fs.stat("/test/path/sub", (err, r4) => { assert.strictEqual(r4.cached, undefined); done(); }); }); }); }); }); it("should purge readdir of the exact directory when exact: true", (t, done) => { fs.readdir("/test/path", (err, r1) => { assert.strictEqual(r1[0], "0"); fs.readdir("/test/path/sub", (err, r2) => { assert.strictEqual(r2[0], "1"); // Without exact, purging the dir path strips to dirname and prefix-purges // readdir for that parent — meaning readdir("/test/path") would NOT be evicted // by purge("/test/path/sub") in legacy mode (parent is "/test/path/", child of // which is "/test/path/sub", but readdir key is "/test/path"). With exact: true // the caller is naming the directory itself, so it should evict directly. fs.purge("/test/path", { exact: true }); fs.readdir("/test/path", (err, r3) => { assert.strictEqual(r3[0], "2"); // sibling readdir cache should still be intact fs.readdir("/test/path/sub", (err, r4) => { assert.strictEqual(r4[0], "1"); done(); }); }); }); }); }); it("should accept Buffer with exact: true", (t, done) => { fs.stat("/test/path", (err, r1) => { r1.cached = true; fs.stat("/test/path/sub", (err, r2) => { r2.cached = true; fs.purge(Buffer.from("/test/path"), { exact: true }); fs.stat("/test/path", (err, r3) => { assert.strictEqual(r3.cached, undefined); fs.stat("/test/path/sub", (err, r4) => { assert.strictEqual(r4.cached, true); fs.purge([Buffer.from("/test/path/sub")], { exact: true, }); fs.stat("/test/path/sub", (err, r5) => { assert.strictEqual(r5.cached, undefined); done(); }); }); }); }); }); }); it("should not stack overflow when resolving in an async loop", (t, done) => { let i = 10000; const next = () => { fs.stat(__dirname, (_err, result) => { assert.notStrictEqual(result, undefined); if (i-- > 0) { next(); } else { done(); } }); }; next(); }); }); describe("cachedInputFileSystem CacheBackend with Infinity duration", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem( { stat(path, options, callback) { if (!callback) { callback = options; options = undefined; } setTimeout( callback.bind(null, null, { path, options, }), 100, ); }, // @ts-expect-error for tests statSync(path, options) { return { path, options, }; }, }, Infinity, ); }); afterEach(() => { fs.purge(); }); it("should not crash the constructor with Infinity", () => { assert.notStrictEqual(fs, undefined); }); it("should cache accesses forever", (t, done) => { fs.stat("a", (err, result) => { result.a = true; fs.stat("a", (err, result) => { assert.notStrictEqual(result.a, undefined); setTimeout(() => { fs.stat("a", (err, result) => { assert.notStrictEqual(result.a, undefined); done(); }); }, 100); }); }); }); it("should cache sync accesses forever", () => { const result = fs.statSync("a"); result.a = true; const result2 = fs.statSync("a"); assert.notStrictEqual(result2.a, undefined); }); }); describe("cachedInputFileSystem CacheBackend and Node.JS filesystem", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem(require("fs"), 1); }); const file = path.resolve(__dirname, "./fixtures/abc.txt"); it("should work with string async", (t, done) => { fs.readFile(file, (err, r) => { if (err) { done(err); return; } assert.strictEqual(r.toString(), "abc"); done(); }); }); it("should work with string sync", () => { const r = fs.readFileSync(file); assert.strictEqual(r.toString(), "abc"); }); it("should work with Buffer async", (t, done) => { fs.readFile(Buffer.from(file), (err, r) => { if (err) { done(err); return; } assert.strictEqual(r.toString(), "abc"); done(); }); }); it("should work with Buffer sync", () => { const r = fs.readFileSync(Buffer.from(file)); assert.strictEqual(r.toString(), "abc"); }); it("should work with URL async", (t, done) => { fs.readFile(url.pathToFileURL(file), (err, r) => { if (err) { done(err); return; } assert.strictEqual(r.toString(), "abc"); done(); }); }); it("should work with URL sync", () => { const r = fs.readFileSync(url.pathToFileURL(file)); assert.strictEqual(r.toString(), "abc"); }); }); describe("cachedInputFileSystem OperationMergerBackend and Node.JS filesystem", () => { let fs; beforeEach(() => { fs = new CachedInputFileSystem(require("fs"), 0); }); const file = path.resolve(__dirname, "./fixtures/abc.txt"); it("should work with string async", (t, done) => { fs.readFile(file, (err, r) => { if (err) { done(err); return; } assert.strictEqual(r.toString(), "abc"); done(); }); }); it("should work with string sync", () => { const r = fs.readFileSync(file); assert.strictEqual(r.toString(), "abc"); }); it("should work with Buffer async", (t, done) => { fs.readFile(Buffer.from(file), (err, r) => { if (err) { done(err); return; } assert.strictEqual(r.toString(), "abc"); done(); }); }); it("should work with Buffer sync", () => { const r = fs.readFileSync(Buffer.from(file)); assert.strictEqual(r.toString(), "abc"); }); it("should work with URL async", (t, done) => { fs.readFile(url.pathToFileURL(file), (err, r) => { if (err) { done(err); return; } assert.strictEqual(r.toString(), "abc"); done(); }); }); it("should work with URL sync", () => { const r = fs.readFileSync(url.pathToFileURL(file)); assert.strictEqual(r.toString(), "abc"); }); }); webpack-enhanced-resolve-7dfc9bc/test/DescriptionFileUtils.test.js000066400000000000000000000035541523262174200255430ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const DescriptionFileUtils = require("../lib/DescriptionFileUtils"); const { describe, it } = require("./_runner"); /* eslint-disable jsdoc/reject-any-type */ // Pure-function tests for helpers exported by DescriptionFileUtils, matching // the style of test/getPaths.test.js and test/identifier.test.js for lib/ // modules whose helpers are difficult to exercise end-to-end. describe("DescriptionFileUtils.cdUp", () => { it("returns null for '/'", () => { assert.strictEqual(DescriptionFileUtils.cdUp("/"), null); }); it("returns null for inputs without separators", () => { // cspell:ignore noslash assert.strictEqual(DescriptionFileUtils.cdUp("noslash"), null); }); it("returns '/' when stripping the last directory", () => { assert.strictEqual(DescriptionFileUtils.cdUp("/foo"), "/"); }); it("descends one level for posix paths", () => { assert.strictEqual(DescriptionFileUtils.cdUp("/a/b/c"), "/a/b"); }); it("descends one level for windows paths", () => { assert.strictEqual(DescriptionFileUtils.cdUp("C:\\a\\b\\c"), "C:\\a\\b"); }); }); describe("DescriptionFileUtils.getField", () => { it("returns undefined for empty content", () => { assert.strictEqual( DescriptionFileUtils.getField(/** @type {any} */ (null), "x"), undefined, ); }); it("walks an array field path", () => { const data = { a: { b: { c: 42 } } }; assert.strictEqual( DescriptionFileUtils.getField(/** @type {any} */ (data), ["a", "b", "c"]), 42, ); }); it("returns null when the path is broken mid-traversal", () => { assert.strictEqual( DescriptionFileUtils.getField(/** @type {any} */ ({ a: 1 }), ["a", "b"]), null, ); }); it("returns the field value for a string field", () => { assert.strictEqual( DescriptionFileUtils.getField(/** @type {any} */ ({ name: "x" }), "name"), "x", ); }); }); webpack-enhanced-resolve-7dfc9bc/test/_runner.js000066400000000000000000000066551523262174200221360ustar00rootroot00000000000000// @ts-nocheck // (This bridge is intentionally untyped: it branches on the runtime // (jest vs node:test) and patches `assert` at module load. The assertion // polyfills mirror Node's real `assert.match`/`assert.doesNotMatch` shape, // and the jest branch only runs when the `jest` global is in scope.) "use strict"; // TODO: drop this file once `engines.node` is bumped to >= 18. The test // files can then `require("node:test")` directly, the jest bridge below // is no longer reachable, and the `assert.match`/`doesNotMatch` polyfills // (needed only on Node.js < 13.6) become dead code. // Bridge between `node:test` and jest-compatible runners so a single test // source runs on: // - Node.js 18+ via the built-in `node --test` runner. // - Legacy Node.js (10-16) via jest, which doesn't ship `node:test`. // - Bun via its built-in jest-compatible runner. // The runtime is auto-detected by the presence of jest's `jest` global. const assert = require("assert"); // `assert.match` and `assert.doesNotMatch` were added in Node.js 13.6. Legacy // jest CI also runs on Node.js 10/12, so polyfill them when missing. The // signature mirrors the built-in. if (typeof assert.match !== "function") { assert.match = function match(value, regExp, message) { if (!regExp.test(value)) { throw new assert.AssertionError({ message: message || `The input did not match the regular expression ${regExp}. Input:\n\n${value}\n`, actual: value, expected: regExp, operator: "match", }); } }; } if (typeof assert.doesNotMatch !== "function") { assert.doesNotMatch = function doesNotMatch(value, regExp, message) { if (regExp.test(value)) { throw new assert.AssertionError({ message: message || `The input matched the regular expression ${regExp}. Input:\n\n${value}\n`, actual: value, expected: regExp, operator: "doesNotMatch", }); } }; } // Adapt a jest-shaped helper bag (jest's globals or `bun:test`) to the // node:test surface the test files use. jest-style callbacks take `(done)`; // node:test passes `(t, done)`, so wrap to inject a throwaway `t` when the // jest-compatible runner invokes the test function. `describe` is passed // through unchanged so `describe.skip` keeps working on every runtime // (the only host-level skip the suite uses). const wrap = (fn) => typeof fn === "function" && fn.length >= 2 ? function bridged(done) { return fn.call(this, {}, done); } : fn; const named = (register) => (name, fn) => register(name, wrap(fn)); const bridge = (source) => ({ describe: source.describe, it: named(source.it), test: named(source.test), before: source.beforeAll, after: source.afterAll, beforeEach: source.beforeEach, afterEach: source.afterEach, }); // Pick the source of the test helpers based on the runtime: // - Bun: always use `bun:test`. Bun ships its own (partial) `node:test` // implementation that throws on top-level `describe()` calls in some // setups; `bun:test` is the supported entry point. // - jest (no `Bun` global, `jest` global is in scope): use jest's helpers, // which jest attaches to `global`. This is the legacy-Node and Deno path. // - Otherwise: the Node.js built-in `node:test`. if (typeof Bun !== "undefined") { // eslint-disable-next-line import/no-unresolved module.exports = bridge(require("bun:test")); } else if (typeof jest === "undefined") { module.exports = require("node:test"); } else { module.exports = bridge(global); } webpack-enhanced-resolve-7dfc9bc/test/alias.test.js000066400000000000000000000346651523262174200225370ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { Volume } = require("memfs"); const { ResolverFactory } = require("../"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const { beforeEach, describe, it } = require("./_runner"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); describe("alias", () => { let resolver; beforeEach(() => { const fileSystem = Volume.fromJSON( { "/a/index": "", "/a/dir/index": "", "/recursive/index": "", "/recursive/dir/index": "", "/b/index": "", "/b/dir/index": "", "/c/index": "", "/c/dir/index": "", "/d/index.js": "", "/d/dir/.empty": "", "/e/index": "", "/e/anotherDir/index": "", "/e/dir/file": "", "/src/utils/a": "", "/src/components/b": "", }, "/", ); resolver = ResolverFactory.createResolver({ alias: { aliasA: "a", b$: "a/index", c$: "/a/index", multiAlias: ["b", "c", "d", "e", "a"], recursive: "recursive/dir", "/d/dir": "/c/dir", "/d/index.js": "/c/index", // alias configuration should work "#": "/c/dir", "@": "/c/dir", "@*": "/*", "@e*": "/e/*", "@e*file": "/e*file", "shared/*": ["/src/utils/*", "/src/components/*"], ignored: false, }, modules: "/", useSyncFileSystemCalls: true, // @ts-expect-error for tests fileSystem, }); }); it("should resolve a not aliased module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "a"), "/a/index"); assert.strictEqual(resolver.resolveSync({}, "/", "a/index"), "/a/index"); assert.strictEqual(resolver.resolveSync({}, "/", "a/dir"), "/a/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "a/dir/index"), "/a/dir/index", ); }); it("should resolve an aliased module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "aliasA"), "/a/index"); assert.strictEqual( resolver.resolveSync({}, "/", "aliasA/index"), "/a/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "aliasA/dir"), "/a/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "aliasA/dir/index"), "/a/dir/index", ); }); it('should resolve "#" alias', () => { assert.strictEqual(resolver.resolveSync({}, "/", "#"), "/c/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "#/index"), "/c/dir/index", ); }); it('should resolve "@" alias', () => { assert.strictEqual(resolver.resolveSync({}, "/", "@"), "/c/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "@/index"), "/c/dir/index", ); }); it("should resolve wildcard alias", () => { assert.strictEqual(resolver.resolveSync({}, "/", "@a"), "/a/index"); assert.strictEqual(resolver.resolveSync({}, "/", "@a/dir"), "/a/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "@e/dir/file"), "/e/dir/file", ); assert.strictEqual( resolver.resolveSync({}, "/", "@e/anotherDir"), "/e/anotherDir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "@e/dir/file"), "/e/dir/file", ); }); it("should resolve an ignore module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "ignored"), false); }); it("should resolve a recursive aliased module", () => { assert.strictEqual( resolver.resolveSync({}, "/", "recursive"), "/recursive/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "recursive/index"), "/recursive/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "recursive/dir"), "/recursive/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "recursive/dir/index"), "/recursive/dir/index", ); }); it("should resolve a file aliased module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "b"), "/a/index"); assert.strictEqual(resolver.resolveSync({}, "/", "c"), "/a/index"); }); it("should resolve a file aliased module with a query", () => { assert.strictEqual( resolver.resolveSync({}, "/", "b?query"), "/a/index?query", ); assert.strictEqual( resolver.resolveSync({}, "/", "c?query"), "/a/index?query", ); }); it("should resolve a path in a file aliased module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "b/index"), "/b/index"); assert.strictEqual(resolver.resolveSync({}, "/", "b/dir"), "/b/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "b/dir/index"), "/b/dir/index", ); assert.strictEqual(resolver.resolveSync({}, "/", "c/index"), "/c/index"); assert.strictEqual(resolver.resolveSync({}, "/", "c/dir"), "/c/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "c/dir/index"), "/c/dir/index", ); }); it("should resolve a file aliased file", () => { assert.strictEqual(resolver.resolveSync({}, "/", "d"), "/c/index"); assert.strictEqual( resolver.resolveSync({}, "/", "d/dir/index"), "/c/dir/index", ); }); it("should resolve a file in multiple aliased dirs", () => { assert.strictEqual( resolver.resolveSync({}, "/", "multiAlias/dir/file"), "/e/dir/file", ); assert.strictEqual( resolver.resolveSync({}, "/", "multiAlias/anotherDir"), "/e/anotherDir/index", ); }); it("should log the correct info", (t, done) => { const log = []; resolver.resolve( {}, "/", "aliasA/dir", { log: (v) => log.push(v) }, (err, result) => { if (err) return done(err); assert.strictEqual(result, "/a/dir/index"); assert.deepStrictEqual(log, [ "resolve 'aliasA/dir' in '/'", " Parsed request is a module", " No description file found in / or above", " aliased with mapping 'aliasA': 'a' to 'a/dir'", " Parsed request is a module", " No description file found in / or above", " resolve as module", " looking for modules in /", " existing directory /a", " No description file found in /a or above", " No description file found in /a or above", " no extension", " /a/dir is not a file", " .js", " /a/dir.js doesn't exist", " .json", " /a/dir.json doesn't exist", " .node", " /a/dir.node doesn't exist", " as directory", " existing directory /a/dir", " No description file found in /a/dir or above", " using path: /a/dir/index", " No description file found in /a/dir or above", " no extension", " existing file: /a/dir/index", " reporting result /a/dir/index", ]); done(); }, ); }); it("should work with absolute paths", (t, done) => { const resolver = ResolverFactory.createResolver({ alias: { [path.resolve(__dirname, "fixtures", "foo")]: false, }, modules: path.resolve(__dirname, "fixtures"), fileSystem: nodeFileSystem, }); resolver.resolve({}, __dirname, "foo/index", {}, (err, result) => { if (err) done(err); assert.strictEqual(result, false); done(); }); }); // Regression guard for the `firstCharCode` screen added in // AliasUtils. Absolute-path aliases must keep matching both when the // request is a raw absolute-path string (`request.request`, hits the // `nameWithSlash` branch at the `raw-resolve` hook) and after // `JoinRequestPlugin` has turned it into a joined `request.path` // (hits the `absolutePath` branch at the `file` hook). If the // char-code screen ever diverges from the startsWith comparison // these resolves silently fall through to the original target. it("should not skip absolute path aliasing", () => { assert.strictEqual(resolver.resolveSync({}, "/", "/d/dir"), "/c/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "/d/dir/index"), "/c/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "d/dir/index"), "/c/dir/index", ); assert.strictEqual(resolver.resolveSync({}, "/", "d"), "/c/index"); }); it("should resolve a wildcard alias with multiple targets correctly", () => { assert.strictEqual( resolver.resolveSync({}, "/", "shared/b"), "/src/components/b", ); }); // Absolute-path aliasing — OS-native (posix on Linux CI, backslash // on Windows CI). // // These cases drive the full `resolver.resolve` pipeline against the // real `test/fixtures/` tree with `CachedInputFileSystem` — no // filesystem or matcher mocking. Paths are built through the Node // `path` module, so on Linux the alias name uses forward slashes // and on Windows the same test code exercises native backslashes. // That covers the regression the previous commit fixed // (`nameWithSlash` hardcodes `/`, which silently skipped native // backslash windows subpaths at the `raw-resolve` hook). describe("absolute path aliasing (OS-native)", () => { const fixturesDir = path.resolve(__dirname, "fixtures"); // `imaginary-foo` deliberately does NOT exist on disk so the // only way the resolver can succeed for requests under it is // through the alias. const aliasName = path.resolve(fixturesDir, "imaginary-foo"); const aliasTarget = path.resolve(fixturesDir, "foo"); const expectedIndex = path.resolve(aliasTarget, "index.js"); const absResolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { [aliasName]: aliasTarget }, fileSystem: nodeFileSystem, }); it("aliases a raw absolute subpath request (raw-resolve hook)", (t, done) => { // path.join uses the OS-native separator, so on windows this // is `...\\imaginary-foo\\index` and exercises the backslash // fallback; on linux it is `.../imaginary-foo/index`. absResolver.resolve( {}, fixturesDir, path.join(aliasName, "index"), {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, expectedIndex); done(); }, ); }); it("aliases a request that equals the alias name (exact equality)", (t, done) => { absResolver.resolve({}, fixturesDir, aliasName, {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, expectedIndex); done(); }); }); it("aliases after JoinRequestPlugin normalizes the path (file hook)", (t, done) => { // A relative request hits `JoinRequestPlugin` first, which // turns it into `request.path` with `request.request` set to // `undefined`. That hits the `absolutePath`-only branch of // the matcher. absResolver.resolve( {}, fixturesDir, `./${path.basename(aliasName)}/index`, {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, expectedIndex); done(); }, ); }); it("does not fire for a different absolute prefix sharing the same head", (t, done) => { // `imaginary-food` shares `imaginary-foo` as a prefix but // not `imaginary-foo`. The alias must not fire, and // since `imaginary-food` does not exist, the resolve fails. const requestPath = path.join(fixturesDir, "imaginary-food", "index"); absResolver.resolve({}, fixturesDir, requestPath, {}, (err, result) => { assert.ok(err instanceof Error); assert.ok(!result); done(); }); }); }); // Regression tests for the watch-mode fallback described in // https://github.com/webpack/enhanced-resolve/issues/395 and // https://github.com/webpack/enhanced-resolve/issues/250. // // When an alias maps to an array of target paths (used for // theme-override-style setups), a subsequent resolve after one of the // target files is deleted must gracefully fall back to the next target // in the array instead of holding on to the previously-resolved path. // Conversely, a newly created higher-priority file must be used on the // next resolve. describe("multi-target alias (theme override) watch-mode behavior", () => { const AliasPlugin = require("../lib/AliasPlugin"); /** * Builds a fresh resolver over an in-memory filesystem with a * `theme` alias that maps to two directories in priority order. * @param {Record} files initial file contents keyed by absolute path * @returns {{ resolver: import("../").Resolver, fileSystem: import("memfs").Volume }} helpers */ const createThemeResolver = (files) => { const fileSystem = Volume.fromJSON(files, "/"); const resolver = ResolverFactory.createResolver({ extensions: [".js"], useSyncFileSystemCalls: true, // @ts-expect-error for tests fileSystem, plugins: [ new AliasPlugin( "described-resolve", [{ name: "theme", alias: ["/fancy-theme", "/default-theme"] }], "resolve", ), ], }); return { resolver, fileSystem }; }; it("falls back to the next target once the preferred file is removed", () => { const { resolver, fileSystem } = createThemeResolver({ "/fancy-theme/Hello.js": "", "/default-theme/Hello.js": "", }); assert.strictEqual( resolver.resolveSync({}, "/", "theme/Hello"), "/fancy-theme/Hello.js", ); fileSystem.unlinkSync("/fancy-theme/Hello.js"); assert.strictEqual( resolver.resolveSync({}, "/", "theme/Hello"), "/default-theme/Hello.js", ); }); it("picks up a newly created higher-priority file", () => { const { resolver, fileSystem } = createThemeResolver({ "/default-theme/Hello.js": "", }); assert.strictEqual( resolver.resolveSync({}, "/", "theme/Hello"), "/default-theme/Hello.js", ); fileSystem.mkdirSync("/fancy-theme"); fileSystem.writeFileSync("/fancy-theme/Hello.js", ""); assert.strictEqual( resolver.resolveSync({}, "/", "theme/Hello"), "/fancy-theme/Hello.js", ); }); it("reports a missing-higher-priority path as a missing dependency so watchers can invalidate", (t, done) => { const { resolver } = createThemeResolver({ "/default-theme/Hello.js": "", }); const fileDependencies = new Set(); const missingDependencies = new Set(); resolver.resolve( {}, "/", "theme/Hello", { fileDependencies, missingDependencies }, (err, result) => { if (err) return done(err); assert.strictEqual(result, "/default-theme/Hello.js"); // The winning file is tracked so that deletions invalidate. assert.strictEqual( fileDependencies.has("/default-theme/Hello.js"), true, ); // The non-existent higher-priority file is tracked so that // its creation triggers a re-resolve (see issue #250). assert.strictEqual( missingDependencies.has("/fancy-theme/Hello.js"), true, ); done(); }, ); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/browserField.test.js000066400000000000000000000121531523262174200240610ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { ResolverFactory } = require("../"); const { beforeEach, describe, it } = require("./_runner"); const browserModule = path.join(__dirname, "fixtures", "browser-module"); /** * @param {string[]} args args * @returns {string} path */ function pp(...args) { return path.join(browserModule, ...args); } describe("browserField", () => { let resolver; beforeEach(() => { resolver = ResolverFactory.createResolver({ aliasFields: [ "browser", ["innerBrowser1", "field2", "browser"], // not presented ["innerBrowser1", "field", "browser"], ["innerBrowser2", "browser"], ], useSyncFileSystemCalls: true, fileSystem: fs, }); }); it("should ignore", (t, done) => { resolver.resolve({}, pp(), "./lib/ignore", {}, (err, result) => { if (err) throw err; assert.strictEqual(result, false); done(); }); }); it("should ignore #2", () => { assert.strictEqual(resolver.resolveSync({}, pp(), "./lib/ignore"), false); assert.strictEqual( resolver.resolveSync({}, pp(), "./lib/ignore.js"), false, ); assert.strictEqual(resolver.resolveSync({}, pp("lib"), "./ignore"), false); assert.strictEqual( resolver.resolveSync({}, pp("lib"), "./ignore.js"), false, ); }); it("should replace a file", () => { assert.deepStrictEqual( resolver.resolveSync({}, pp(), "./lib/replaced"), pp("lib", "browser.js"), ); assert.deepStrictEqual( resolver.resolveSync({}, pp(), "./lib/replaced.js"), pp("lib", "browser.js"), ); assert.deepStrictEqual( resolver.resolveSync({}, pp("lib"), "./replaced"), pp("lib", "browser.js"), ); assert.deepStrictEqual( resolver.resolveSync({}, pp("lib"), "./replaced.js"), pp("lib", "browser.js"), ); }); it("should replace a module with a file", () => { assert.deepStrictEqual( resolver.resolveSync({}, pp(), "module-a"), pp("browser", "module-a.js"), ); assert.deepStrictEqual( resolver.resolveSync({}, pp("lib"), "module-a"), pp("browser", "module-a.js"), ); }); it("should replace a module with a module", () => { assert.deepStrictEqual( resolver.resolveSync({}, pp(), "module-b"), pp("node_modules", "module-c.js"), ); assert.deepStrictEqual( resolver.resolveSync({}, pp("lib"), "module-b"), pp("node_modules", "module-c.js"), ); }); it("should resolve in nested property", () => { assert.deepStrictEqual( resolver.resolveSync({}, pp(), "./lib/main1.js"), pp("lib", "main.js"), ); assert.deepStrictEqual( resolver.resolveSync({}, pp(), "./lib/main2.js"), pp("lib", "browser.js"), ); }); it("should check only alias field properties", () => { assert.deepStrictEqual( resolver.resolveSync({}, pp(), "./toString"), pp("lib", "toString.js"), ); }); const aliasFieldExtras = path.join( __dirname, "fixtures", "alias-field-extras", ); it("falls through when the browser alias value equals the inner request", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], aliasFields: ["browser"], fileSystem: fs, }); resolver.resolve( {}, aliasFieldExtras, "./self-alias", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.join(aliasFieldExtras, "self-alias.js"), ); done(); }, ); }); it("falls through when a module alias value equals the inner request", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], aliasFields: ["browser"], fileSystem: fs, }); resolver.resolve({}, aliasFieldExtras, "pkg", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.join(aliasFieldExtras, "node_modules/pkg/index.js"), ); done(); }); }); it("propagates a resolution error when the browser alias target cannot be found", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], aliasFields: ["browser"], fileSystem: fs, }); resolver.resolve({}, aliasFieldExtras, "./points-nowhere", {}, (err) => { assert.ok(err instanceof Error); done(); }); }); it("leaves resolution untouched when the configured field does not exist", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], aliasFields: ["nonexistentField"], fileSystem: fs, }); resolver.resolve( {}, path.join(__dirname, "fixtures", "browser-module"), "./lib/main.js", {}, (err) => { // Either resolves or errors — we just want to exercise the path. assert.strictEqual(err === null || err instanceof Error, true); done(); }, ); }); it("short-circuits when a browser field marks a path as false (directory ignore)", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], aliasFields: ["browser"], fileSystem: fs, }); resolver.resolve( {}, path.join(__dirname, "fixtures", "browser-module"), "./lib/ignore", {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, false); done(); }, ); }); }); webpack-enhanced-resolve-7dfc9bc/test/dependencies.test.js000066400000000000000000000054011523262174200240560ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { Volume } = require("memfs"); const resolve = require("../"); const { beforeEach, describe, it } = require("./_runner"); describe("dependencies", () => { let resolver; beforeEach(() => { const fileSystem = Volume.fromJSON( { "/a/b/node_modules/some-module/index.js": "", "/a/node_modules/module/package.json": JSON.stringify({ main: "entry.js", }), "/a/node_modules/module/file.js": JSON.stringify({ main: "entry.js" }), "/modules/other-module/file.js": "", }, "/", ); resolver = resolve.create({ extensions: [".json", ".js"], modules: ["/modules", "node_modules"], // @ts-expect-error for tests fileSystem, }); }); const testCases = [ { name: "middle module request", context: "/a/b/c", request: "module/file", result: "/a/node_modules/module/file.js", fileDependencies: [ // found package.json "/a/node_modules/module/package.json", // symlink checks "/a/node_modules/module/file.js", "/a/node_modules/module", "/a/node_modules", "/a", "/", ], missingDependencies: [ // missing package.jsons "/a/b/c/package.json", "/a/b/package.json", "/a/package.json", "/package.json", // missing modules directories "/a/b/c/node_modules", // missing single file modules "/modules/module", "/a/b/node_modules/module", // missing files with alterative extensions "/a/node_modules/module/file", "/a/node_modules/module/file.json", ], }, { name: "fast found module request", context: "/a/b/c", request: "other-module/file.js", result: "/modules/other-module/file.js", fileDependencies: [ // symlink checks "/modules/other-module/file.js", "/modules/other-module", "/modules", "/", ], missingDependencies: [ // missing package.jsons "/a/b/c/package.json", "/a/b/package.json", "/a/package.json", "/package.json", "/modules/other-module/package.json", "/modules/package.json", ], }, ]; for (const testCase of testCases) { // eslint-disable-next-line no-loop-func it(`should report correct dependencies for ${testCase.name}`, (t, done) => { const fileDependencies = new Set(); const missingDependencies = new Set(); resolver( testCase.context, testCase.request, { fileDependencies, missingDependencies, }, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, testCase.result); assert.deepStrictEqual( [...fileDependencies].sort(), testCase.fileDependencies.sort(), ); assert.deepStrictEqual( [...missingDependencies].sort(), testCase.missingDependencies.sort(), ); done(); }, ); }); } }); webpack-enhanced-resolve-7dfc9bc/test/description-file.test.js000066400000000000000000000103651523262174200246750ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); /* eslint-disable jsdoc/reject-any-type */ const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const fixtures = path.join(__dirname, "fixtures"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); /** * Wrap a graceful-fs-style file system to drop `readJson`, forcing the * resolver to go through the JSONC parsing fallback path. * @returns {import("../lib/Resolver").FileSystem} filesystem without readJson */ function fsWithoutReadJson() { return /** @type {any} */ ({ stat: fs.stat.bind(fs), statSync: fs.statSync.bind(fs), readdir: fs.readdir.bind(fs), readdirSync: fs.readdirSync.bind(fs), readFile: fs.readFile.bind(fs), readFileSync: fs.readFileSync.bind(fs), readlink: fs.readlink.bind(fs), readlinkSync: fs.readlinkSync.bind(fs), lstat: fs.lstat.bind(fs), lstatSync: fs.lstatSync.bind(fs), realpath: fs.realpath.bind(fs), realpathSync: fs.realpathSync.bind(fs), }); } describe("description file (readFile fallback)", () => { it("surfaces 'No content in file' when the description file is empty", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: fsWithoutReadJson(), extensions: [".js"], }); resolver.resolve( {}, path.join(fixtures, "empty-description-file"), ".", {}, (err) => { assert.ok(err instanceof Error); assert.match( /** @type {Error} */ (err).message, /No content in file|Unexpected end of JSON|Unexpected EOF|Can't resolve/, ); done(); }, ); }); it("surfaces a parse error when the description file contains invalid JSON", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: fsWithoutReadJson(), extensions: [".js"], }); resolver.resolve( {}, path.join(fixtures, "bad-description-file"), ".", {}, (err) => { assert.ok(err instanceof Error); done(); }, ); }); it("resolves through the readFile path when readJson is not available", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: fsWithoutReadJson(), extensions: [".js"], }); resolver.resolve({}, fixtures, "m1/a", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.join(fixtures, "node_modules/m1/a.js"), ); done(); }); }); }); describe("self-reference resolution", () => { const selfPkg = path.join(fixtures, "self-reference-pkg"); it("resolves a package's own name via the exports field", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, conditionNames: ["node"], exportsFields: ["exports"], }); resolver.resolve({}, selfPkg, "self-pkg", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(selfPkg, "index.js")); done(); }); }); it("resolves a sub-path via self-reference + exports", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, conditionNames: ["node"], exportsFields: ["exports"], }); resolver.resolve({}, selfPkg, "self-pkg/sub", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(selfPkg, "sub.js")); done(); }); }); it("falls through when the request is not the package name", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], conditionNames: ["node"], exportsFields: ["exports"], }); resolver.resolve({}, selfPkg, "./index", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(selfPkg, "index.js")); done(); }); }); }); describe("self-reference negative case", () => { it("does not self-reference when the package name doesn't match the request prefix", (t, done) => { const selfPkg = path.join(fixtures, "self-reference-pkg"); const resolver = ResolverFactory.createResolver({ extensions: [".js"], conditionNames: ["node"], exportsFields: ["exports"], fileSystem: nodeFileSystem, }); resolver.resolve({}, selfPkg, "other-pkg", {}, (err) => { assert.ok(err instanceof Error); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/dos-device-paths.test.js000066400000000000000000000103371523262174200245730ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); /* eslint-disable jsdoc/reject-any-type */ const path = require("path"); const { ResolverFactory } = require("../"); const { describe, test } = require("./_runner"); // DOS device paths (`\\?\…`, `\\.\…`) are Windows-only constructs. The real // resolver tests below hit the actual filesystem through those prefixes, so // they only make sense on a Windows host. `describe.skip` elsewhere keeps CI // on other platforms green while still validating the pure logic via // `path.test.js` and `identifier.test.js`. const describeWin = process.platform === "win32" ? describe : describe.skip; describeWin("DOS device path resolution (Windows)", () => { // `path.resolve` gives us the real Windows-absolute form of the fixtures // directory (e.g. `C:\…\test\fixtures`), which we then re-address through // the Win32 file (`\\?\`) and device (`\\.\`) namespaces. const fixtures = path.resolve(__dirname, "fixtures"); const dosFixtures = `\\\\?\\${fixtures}`; const dotFixtures = `\\\\.\\${fixtures}`; // `symlinks: false` keeps the result verbatim — the realpath plugin would // otherwise strip the DOS prefix on Windows, masking what we want to test. // Default (async) filesystem calls are used — sync fs is deliberately // avoided so this exercises the same code paths as production resolves. const resolver = ResolverFactory.createResolver({ fileSystem: fs, extensions: [".js"], symlinks: false, }); test("resolves a relative request against a \\\\?\\ context", async () => { assert.strictEqual( await resolver.resolvePromise({}, dosFixtures, "./a"), path.join(dosFixtures, "a.js"), ); }); test("resolves a relative request to a subdirectory's index.js", async () => { assert.strictEqual( await resolver.resolvePromise({}, dosFixtures, "./foo"), path.join(dosFixtures, "foo", "index.js"), ); }); test("resolves '.' to index.js in a \\\\?\\ context", async () => { assert.strictEqual( await resolver.resolvePromise({}, path.join(dosFixtures, "foo"), "."), path.join(dosFixtures, "foo", "index.js"), ); }); test("resolves an absolute \\\\?\\ request regardless of context", async () => { const request = path.join(dosFixtures, "a"); assert.strictEqual( await resolver.resolvePromise({}, fixtures, request), path.join(dosFixtures, "a.js"), ); }); test("resolves through the \\\\.\\ device namespace", async () => { // The `\\.\` walk used to infinite-loop in `cdUp` once it reached // the bare `\` root — this test proves it terminates. assert.strictEqual( await resolver.resolvePromise({}, dotFixtures, "./a"), path.join(dotFixtures, "a.js"), ); }); test("preserves a query string on a \\\\?\\ request", async () => { // The literal `?` inside `\\?\` must not be mistaken for a query // separator — the real query is the one trailing the path. const request = `${path.join(dosFixtures, "a")}?foo=bar`; assert.strictEqual( await resolver.resolvePromise({}, fixtures, request), `${path.join(dosFixtures, "a.js")}?foo=bar`, ); }); test("preserves a fragment on a \\\\?\\ request", async () => { const request = `${path.join(dosFixtures, "a")}#frag`; assert.strictEqual( await resolver.resolvePromise({}, fixtures, request), `${path.join(dosFixtures, "a.js")}#frag`, ); }); test("rejects a missing file under a DOS device context", async () => { await assert.rejects( resolver.resolvePromise({}, dosFixtures, "./does-not-exist"), /Can't resolve/, ); }); test("locates the nearest package.json when resolving through \\\\?\\", (t, done) => { // Uses the callback form because the `request` (third callback arg) // carries `descriptionFilePath`, which the promise form drops. resolver.resolve( {}, path.join(dosFixtures, "foo"), ".", {}, (err, result, request) => { if (err) return done(err); assert.strictEqual(result, path.join(dosFixtures, "foo", "index.js")); // The description-file walk must terminate — if `cdUp` didn't // treat bare `\` as a root, this callback would never fire. assert.strictEqual( /** @type {any} */ (request).descriptionFilePath, path.join(dosFixtures, "foo", "package.json"), ); done(); }, ); }); }); webpack-enhanced-resolve-7dfc9bc/test/entrypoints.test.js000066400000000000000000000061221523262174200240270ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { processExportsField, processImportsField, } = require("../lib/util/entrypoints"); const { describe, it } = require("./_runner"); describe("util/entrypoints processExportsField", () => { it("throws when the request ends with '/' (file required)", () => { const processor = processExportsField({ ".": "./index.js" }); assert.throws( () => processor("./", new Set(["node"])), /Only requesting file allowed/, ); }); it("throws when the request does not start with '.'", () => { const processor = processExportsField({ ".": "./index.js" }); assert.throws( () => processor("foo", new Set(["node"])), /should be relative path and start with "\."/, ); }); it("throws when the request length>1 but second char is not '/'", () => { const processor = processExportsField({ ".": "./index.js" }); assert.throws( () => processor("..foo", new Set(["node"])), /should be relative path and start with "\.\/"/, ); }); it("returns an empty array for an unmatched export key", () => { const processor = processExportsField({ ".": "./main.js" }); const [paths] = processor("./not-listed", new Set(["node"])); assert.deepStrictEqual(paths, []); }); it("matches a direct mapping", () => { const processor = processExportsField({ "./a": "./main.js" }); const [paths] = processor("./a", new Set(["node"])); assert.deepStrictEqual(paths, ["./main.js"]); }); it("orders sibling pattern keys consistently", () => { const processor = processExportsField({ "./longer/*": "./l/*", "./a/*": "./a/*", "./shortest": "./s.js", }); const [paths1] = processor("./shortest", new Set(["node"])); assert.deepStrictEqual(paths1, ["./s.js"]); const [paths2] = processor("./a/foo", new Set(["node"])); assert.deepStrictEqual(paths2, ["./a/foo"]); const [paths3] = processor("./longer/foo", new Set(["node"])); assert.deepStrictEqual(paths3, ["./l/foo"]); }); }); describe("util/entrypoints processImportsField", () => { it("throws when the request does not start with '#'", () => { const processor = processImportsField({ "#a": "./main.js" }); assert.throws( () => processor("foo", new Set(["node"])), /should start with "#"/, ); }); it("throws when request is just '#' (too short)", () => { const processor = processImportsField({ "#a": "./main.js" }); assert.throws( () => processor("#", new Set(["node"])), /at least 2 characters/, ); }); it("throws when import request ends with '/'", () => { const processor = processImportsField({ "#a": "./main.js" }); assert.throws( () => processor("#a/", new Set(["node"])), /Only requesting file allowed/, ); }); it("returns an empty array for an unmatched import key", () => { const processor = processImportsField({ "#a": "./main.js" }); const [paths] = processor("#x", new Set(["node"])); assert.deepStrictEqual(paths, []); }); it("matches a direct import key", () => { const processor = processImportsField({ "#a": "./main.js" }); const [paths] = processor("#a", new Set(["node"])); assert.deepStrictEqual(paths, ["./main.js"]); }); }); webpack-enhanced-resolve-7dfc9bc/test/exportsField.test.js000066400000000000000000002174551523262174200241160ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const ResolverFactory = require("../lib/ResolverFactory"); const { processExportsField } = require("../lib/util/entrypoints"); const { describe, it } = require("./_runner"); /** @typedef {import("../lib/util/entrypoints").ExportsField} ExportsField */ const fixture = path.resolve(__dirname, "fixtures", "exports-field"); const fixture2 = path.resolve(__dirname, "fixtures", "exports-field2"); const fixture3 = path.resolve(__dirname, "fixtures", "exports-field3"); const fixture4 = path.resolve(__dirname, "fixtures", "exports-field-error"); const fixture5 = path.resolve( __dirname, "fixtures", "exports-field-invalid-package-target", ); const fixture6 = path.resolve( __dirname, "fixtures", "exports-field-nested-version", ); describe("process exports field", () => { /** @type {{ name: string, expect: string[] | Error, suite: [ExportsField, string, string[]] }[]} */ const testCases = [ // #region Samples { name: "sample #1", expect: ["./dist/test/file.js", "./src/test/file.js"], suite: [ { "./foo/": { import: ["./dist/", "./src/"], webpack: "./wp/", }, ".": "./main.js", }, "./foo/test/file.js", ["import", "webpack"], ], }, { name: "sample #1 (wildcard)", expect: ["./dist/test/file.js", "./src/test/file.js"], suite: [ { "./foo/*": { import: ["./dist/*", "./src/*"], webpack: "./wp/*", }, ".": "./main.js", }, "./foo/test/file.js", ["import", "webpack"], ], }, { name: "sample #2", expect: ["./data/timezones/pdt.mjs"], suite: [ { "./timezones/": "./data/timezones/", }, "./timezones/pdt.mjs", [], ], }, { name: "sample #2 (wildcard)", expect: ["./data/timezones/pdt.mjs"], suite: [ { "./timezones/*": "./data/timezones/*", }, "./timezones/pdt.mjs", [], ], }, { name: "sample #3", // mapping works like concatenating strings not file paths expect: ["./data/timezones/timezones/pdt.mjs"], suite: [ { "./": "./data/timezones/", }, "./timezones/pdt.mjs", [], ], }, { name: "sample #3 (wildcard)", // mapping works like concatenating strings not file paths expect: ["./data/timezones/timezones/pdt.mjs"], suite: [ { "./*": "./data/timezones/*.mjs", }, "./timezones/pdt", [], ], }, { name: "sample #4", expect: [], suite: [ { "./lib/": { browser: ["./browser/"], }, "./dist/index.js": { node: "./index.js", }, }, "./dist/index.js", ["browser"], ], }, { name: "sample #4 (wildcard)", expect: [], suite: [ { "./lib/*": { browser: ["./browser/*"], }, "./dist/index.js": { node: "./index.js", }, }, "./dist/index.js", ["browser"], ], }, { name: "sample #5", expect: ["./browser/index.js"], // default condition used suite: [ { "./lib/": { browser: ["./browser/"], }, "./dist/index.js": { node: "./index.js", default: "./browser/index.js", }, }, "./dist/index.js", ["browser"], ], }, { name: "sample #5 (wildcard)", expect: ["./browser/index.js"], // default condition used suite: [ { "./lib/*": { browser: ["./browser/*"], }, "./dist/index.js": { node: "./index.js", default: "./browser/index.js", }, }, "./dist/index.js", ["browser"], ], }, { name: "sample #6", expect: [], suite: [ { "./dist/a": "./dist/index.js", }, "./dist/aaa", [], ], }, { name: "sample #7", expect: [], suite: [ { "./dist/a/a/": "./dist/index.js", }, "./dist/a/a", [], ], }, { name: "sample #7 (wildcard)", expect: [], suite: [ { "./dist/a/a/*": "./dist/index.js", }, "./dist/a/a", [], ], }, { name: "sample #8", expect: [], suite: [ { ".": "./index.js", }, "./timezones/pdt.mjs", [], ], }, { name: "sample #9", expect: ["./main.js"], suite: [ { "./index.js": "./main.js", }, "./index.js", [], ], }, { name: "sample #10", expect: ["./ok.js"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./#foo", [], ], }, { name: "sample #11", expect: ["./ok.js"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./bar#foo", [], ], }, { name: "sample #12", expect: ["./ok.js#abc"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./#zapp/ok.js#abc", [], ], }, { name: "sample #12", expect: ["./ok.js#abc"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./#zapp/ok.js#abc", [], ], }, { name: "sample #13", expect: ["./ok.js?abc"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./#zapp/ok.js?abc", [], ], }, { name: "sample #14", expect: ["./🎉.js"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./#zapp/🎉.js", [], ], }, { name: "sample #15", expect: ["./%F0%9F%8E%89.js"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, // "🎉" percent encoded "./#zapp/%F0%9F%8E%89.js", [], ], }, { name: "sample #16", expect: ["./ok.js"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./🎉", [], ], }, { name: "sample #17", expect: ["./other.js"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./%F0%9F%8E%89", [], ], }, { name: "sample #18", expect: ["./ok.js"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./module", [], ], }, { name: "sample #19", expect: [], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./module#foo", [], ], }, { name: "sample #20", expect: [], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./zzz*", }, "./module?foo", [], ], }, { name: "sample #21", expect: ["./zizizi"], suite: [ { "./#foo": "./ok.js", "./module": "./ok.js", "./🎉": "./ok.js", "./%F0%9F%8E%89": "./other.js", "./bar#foo": "./ok.js", "./#zapp/": "./", "./#zipp*": "./z*z*z*", }, "./#zippi", [], ], }, { name: "sample #22", expect: ["./d?e?f"], suite: [ { "./a?b?c/": "./", }, "./a?b?c/d?e?f", [], ], }, // #endregion // #region Direct mapping { name: "Direct mapping #1", expect: ["./dist/index.js"], suite: [ { ".": "./dist/index.js", }, ".", [], ], }, { name: "Direct mapping #2", expect: [], suite: [ { "./": "./", "./*": "./*", "./dist/index.js": "./dist/index.js", }, ".", [], ], }, { name: "Direct mapping #3", expect: ["./dist/a.js"], // direct mapping is more prioritize suite: [ { "./dist/": "./dist/", "./dist/*": "./dist/*", "./dist*": "./dist*", "./dist/index.js": "./dist/a.js", }, "./dist/index.js", [], ], }, { name: "Direct mapping #4", expect: ["./index.js"], // direct mapping is more prioritize suite: [ { "./": { browser: ["./browser/"], }, "./*": { browser: ["./browser/*"], }, "./dist/index.js": { browser: "./index.js", }, }, "./dist/index.js", ["browser"], ], }, { name: "Direct mapping #5", // direct mapping is more prioritize, // so there is no match expect: [], suite: [ { "./": { browser: ["./browser/"], }, "./*": { browser: ["./browser/*"], }, "./dist/index.js": { node: "./node.js", }, }, "./dist/index.js", ["browser"], ], }, { name: "Direct mapping #6", expect: ["./index.js"], suite: [ { ".": { browser: "./index.js", node: "./src/node/index.js", default: "./src/index.js", }, }, ".", ["browser"], ], }, { name: "Direct mapping #7", expect: ["./src/index.js"], // Default is first one suite: [ { ".": { default: "./src/index.js", browser: "./index.js", node: "./src/node/index.js", }, }, ".", ["browser"], ], }, { name: "Direct mapping #8", expect: ["./src/index.js"], suite: [ { ".": { browser: "./index.js", node: "./src/node/index.js", default: "./src/index.js", }, }, ".", [], ], }, { name: "Direct mapping #9", expect: ["./index"], // it is fine, file may not have extension suite: [ { ".": "./index", }, ".", [], ], }, { name: "Direct mapping #10", expect: ["./index.js"], suite: [ { "./index": "./index.js", }, "./index", [], ], }, { name: "Direct mapping #11", expect: ["./foo.js"], suite: [ { "./": "./", "./*": "./*", "./dist/index.js": "./dist/index.js", }, "./foo.js", [], ], }, { name: "Direct mapping #12", expect: ["./foo/bar/baz.js"], suite: [ { "./": "./", "./*": "./*", "./dist/index.js": "./dist/index.js", }, "./foo/bar/baz.js", [], ], }, { name: "Direct mapping #13", expect: ["./foo/bar/baz.js"], suite: [ { "./": "./", "./dist/index.js": "./dist/index.js", }, "./foo/bar/baz.js", [], ], }, { name: "Direct mapping #14", expect: ["./foo/bar/baz.js"], suite: [ { "./*": "./*", "./dist/index.js": "./dist/index.js", }, "./foo/bar/baz.js", [], ], }, // #endregion // #region Direct and conditional mapping { name: "Direct and conditional mapping #1", expect: [], suite: [ { ".": [ { browser: "./browser.js" }, { require: "./require.js" }, { import: "./import.mjs" }, ], }, ".", [], ], }, { name: "Direct and conditional mapping #2", expect: ["./import.mjs"], suite: [ { ".": [ { browser: "./browser.js" }, { require: "./require.js" }, { import: "./import.mjs" }, ], }, ".", ["import"], ], }, { name: "Direct and conditional mapping #3", expect: ["./require.js", "./import.mjs"], suite: [ { ".": [ { browser: "./browser.js" }, { require: "./require.js" }, { import: "./import.mjs" }, ], }, ".", ["import", "require"], ], }, { name: "Direct and conditional mapping #4", expect: ["./require.js", "./import.mjs", "./import.js"], suite: [ { ".": [ { browser: "./browser.js" }, { require: ["./require.js"] }, { import: ["./import.mjs", "./import.js"] }, ], }, ".", ["import", "require"], ], }, // #endregion // #region When mapping to a folder root, both the left and right sides must end in slashes { name: "mapping to a folder root #1", expect: [], suite: [ { "./timezones": "./data/timezones/", }, "./timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #2", expect: new Error( 'Expecting folder to folder mapping. "./data/timezones" should end with "/"', ), suite: [ { "./timezones/": "./data/timezones", }, "./timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #3", expect: ["./data/timezones/pdt/index.mjs"], suite: [ { "./timezones/pdt/": "./data/timezones/pdt/", }, "./timezones/pdt/index.mjs", [], ], }, { name: "mapping to a folder root #3 (wildcard)", expect: ["./data/timezones/pdt/index.mjs"], suite: [ { "./timezones/pdt/*": "./data/timezones/pdt/*", }, "./timezones/pdt/index.mjs", [], ], }, { name: "mapping to a folder root #4", expect: ["./timezones/pdt.mjs"], suite: [ { "./": "./timezones/", }, "./pdt.mjs", [], ], }, { name: "mapping to a folder root #4 (wildcard)", expect: ["./timezones/pdt.mjs"], suite: [ { "./*": "./timezones/*", }, "./pdt.mjs", [], ], }, { name: "mapping to a folder root #5", expect: ["./timezones/pdt.mjs"], suite: [ { "./": "./", }, "./timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #5 (wildcard)", expect: ["./timezones/pdt.mjs"], suite: [ { "./*": "./*", }, "./timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #6", expect: new Error( 'Expecting folder to folder mapping. "." should end with "/"', ), suite: [ { "./": ".", }, "./timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #7", expect: [], // incorrect export field, but value did not processed suite: [ { ".": "./", }, "./timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #7 (wildcard)", expect: [], // incorrect export field, but value did not processed suite: [ { ".": "./*", }, "./timezones/pdt.mjs", [], ], }, // #endregion // #region The longest matching path prefix is prioritized { name: "the longest matching path prefix is prioritized #1", // it does not work same as conditional mapping, // so there is no match for ./dist/index.mjs expect: ["./lib/index.mjs"], suite: [ { "./": "./", "./dist/": "./lib/", }, "./dist/index.mjs", [], ], }, { name: "the longest matching path prefix is prioritized #1 (wildcard)", // it does not work same as conditional mapping, // so there is no match for ./dist/index.mjs expect: ["./lib/index.mjs"], suite: [ { "./*": "./*", "./dist/*": "./lib/*", }, "./dist/index.mjs", [], ], }, { name: "the longest matching path prefix is prioritized #2", expect: ["./dist/utils/index.js"], suite: [ { "./dist/utils/": "./dist/utils/", "./dist/": "./lib/", }, "./dist/utils/index.js", [], ], }, { name: "the longest matching path prefix is prioritized #2 (wildcard)", expect: ["./dist/utils/index.js"], suite: [ { "./dist/utils/*": "./dist/utils/*", "./dist/*": "./lib/*", }, "./dist/utils/index.js", [], ], }, { name: "the longest matching path prefix is prioritized #3", // direct mapping is prioritize // it does not work same as conditional mapping, // so there is no match for ./dist/utils/index.mjs expect: ["./dist/utils/index.js"], suite: [ { "./dist/utils/index.js": "./dist/utils/index.js", "./dist/utils/": "./dist/utils/index.mjs", "./dist/": "./lib/", }, "./dist/utils/index.js", [], ], }, { name: "the longest matching path prefix is prioritized #3 (wildcard)", // direct mapping is prioritize // it does not work same as conditional mapping, // so there is no match for ./dist/utils/index.mjs expect: ["./dist/utils/index.js"], suite: [ { "./dist/utils/index.js": "./dist/utils/index.js", "./dist/utils/*": "./dist/utils/index.mjs", "./dist/*": "./lib/*", }, "./dist/utils/index.js", [], ], }, { name: "the longest matching path prefix is prioritized #4", // it does not work same as conditional mapping, // even if right side is a conditional mapping, // so there is no match for ./browser/dist/index.mjs expect: ["./lib/index.mjs"], suite: [ { "./": { browser: "./browser/", }, "./dist/": "./lib/", }, "./dist/index.mjs", ["browser"], ], }, { name: "the longest matching path prefix is prioritized #4 (wildcard)", // it does not work same as conditional mapping, // even if right side is a conditional mapping, // so there is no match for ./browser/dist/index.mjs expect: ["./lib/index.mjs"], suite: [ { "./*": { browser: "./browser/*", }, "./dist/*": "./lib/*", }, "./dist/index.mjs", ["browser"], ], }, // #endregion // #region Conditional mapping folder { name: "conditional mapping folder #1", expect: ["lodash/index.js", "./utils/index.js"], suite: [ { "./utils/": { browser: ["lodash/", "./utils/"], node: ["./utils-node/"], }, }, "./utils/index.js", ["browser"], ], }, { name: "conditional mapping folder #1 (wildcard)", expect: ["lodash/index.js", "./utils/index.js"], suite: [ { "./utils/*": { browser: ["lodash/*", "./utils/*"], node: ["./utils-node/*"], }, }, "./utils/index.js", ["browser"], ], }, { name: "conditional mapping folder #2", expect: [], // no condition names suite: [ { "./utils/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], node: ["./node/"], }, }, "./utils/index.mjs", [], ], }, { name: "conditional mapping folder #2 (wildcard)", expect: [], // no condition names suite: [ { "./utils/*": { webpack: "./wpk/*", browser: ["lodash/*", "./utils/*"], node: ["./node/*"], }, }, "./utils/index.mjs", [], ], }, { name: "conditional mapping folder #3", expect: ["./wpk/index.mjs"], suite: [ { "./utils/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], node: ["./utils/"], }, }, "./utils/index.mjs", ["browser", "webpack"], ], }, { name: "conditional mapping folder #3 (wildcard)", expect: ["./wpk/index.mjs"], suite: [ { "./utils/*": { webpack: "./wpk/*", browser: ["lodash/*", "./utils/*"], node: ["./utils/*"], }, }, "./utils/index.mjs", ["browser", "webpack"], ], }, // #endregion // #region Incorrect exports field definition { name: "incorrect exports field #1", expect: new Error( 'Exports field key should be relative path and start with "." (key: "/utils/")', ), suite: [ { "/utils/": "./a/", }, "./utils/index.mjs", [], ], }, { name: "incorrect exports field #2", expect: new Error( 'Exports field key should be relative path and start with "." (key: "/utils/")', ), suite: [ { "/utils/": { browser: "./a/", default: "./b/", }, }, "./utils/index.mjs", ["browser"], ], }, { name: "incorrect exports field #3 (wildcard)", expect: new Error( 'Expecting file to file mapping. "/a/" should not end with "/"', ), suite: [ { "./utils/*": { browser: "/a/", default: "/b/", }, }, "./utils/index.mjs", ["browser"], ], }, { name: "incorrect exports field #4", expect: [], suite: [ { "./utils/index": "./a/index.js", }, "./utils/index.mjs", [], ], }, { name: "incorrect exports field #5", expect: [], suite: [ { "./utils/index.mjs": "./a/index.js", }, "./utils/index", [], ], }, { name: "incorrect exports field #6", expect: [], suite: [ { "./utils/index": { browser: "./a/index.js", default: "./b/index.js", }, }, "./utils/index.mjs", ["browser"], ], }, { name: "incorrect exports field #7", expect: [], suite: [ { "./utils/index.mjs": { browser: "./a/index.js", default: "./b/index.js", }, }, "./utils/index", ["browser"], ], }, // #endregion // #region Incorrect request { name: "incorrect request #1", expect: new Error('Request should be relative path and start with "."'), suite: [ { "./utils/": "./a/", }, "/utils/index.mjs", [], ], }, { name: "incorrect request #2", expect: new Error('Request should be relative path and start with "."'), suite: [ { "./utils/": { browser: "./a/", default: "./b/", }, }, "/utils/index.mjs", ["browser"], ], }, { name: "incorrect request #3", expect: new Error('Request should be relative path and start with "./"'), suite: [ { "./utils/": { browser: "./a/", default: "./b/", }, }, "../utils/index.mjs", ["browser"], ], }, { name: "incorrect request #4", expect: new Error('Request should be relative path and start with "."'), suite: [ { "./utils/": { browser: "./a/", default: "./b/", }, }, "/utils/index.mjs/", ["browser"], ], }, // #endregion // #region Directory exports targets may not backtrack above the package base { name: "backtracking package base #1", expect: ["./dist/index"], // we don't handle backtracking here suite: [ { "./../../utils/": "./dist/", }, "./../../utils/index", [], ], }, { name: "backtracking package base #1 (wildcard)", expect: ["./dist/index"], // we don't handle backtracking here suite: [ { "./../../utils/*": "./dist/*", }, "./../../utils/index", [], ], }, { name: "backtracking package base #2", expect: new Error( 'Exports field key should be relative path and start with "./" (key: "../../utils/")', ), suite: [ { "../../utils/": "./dist/", }, "../../utils/index", [], ], }, { name: "backtracking package base #2 (wildcard)", expect: new Error( 'Exports field key should be relative path and start with "./" (key: "../../utils/*")', ), suite: [ { "../../utils/*": "./dist/*", }, "../../utils/index", [], ], }, { name: "backtracking package base #3", expect: ["./../src/index"], // we don't handle backtracking here suite: [ { "./utils/": "./../src/", }, "./utils/index", [], ], }, { name: "backtracking package base #3 (wildcard)", expect: ["./../src/index"], // we don't handle backtracking here suite: [ { "./utils/*": "./../src/*", }, "./utils/index", [], ], }, { name: "backtracking package base #4", // fits package base depth expect: ["./src/../index.js"], suite: [ { "./utils/index": "./src/../index.js", }, "./utils/index", [], ], }, { name: "backtracking package base #5", // fits package base depth, // but matching works as string concatenation not file paths expect: [], suite: [ { "./utils/../utils/index": "./src/../index.js", }, "./utils/index", [], ], }, { name: "backtracking package base #6", expect: ["./utils/../index"], suite: [ { "./utils/": { browser: "./utils/../", }, }, "./utils/index", ["browser"], ], }, { name: "backtracking package base #6 (wildcard)", expect: ["./utils/../index"], suite: [ { "./utils/*": { browser: "./utils/../*", }, }, "./utils/index", ["browser"], ], }, { name: "backtracking package base #7", expect: ["./dist/index"], suite: [ { "./": "./src/../../", "./dist/": "./dist/", }, "./dist/index", ["browser"], ], }, { name: "backtracking package base #7 (wildcard)", expect: ["./dist/index"], suite: [ { "./*": "./src/../../*", "./dist/*": "./dist/*", }, "./dist/index", ["browser"], ], }, // #endregion // #region Directory exports subpaths may not backtrack above the target folder { name: "backtracking target folder #1", expect: ["./dist/timezone/../../index"], suite: [ { "./utils/": "./dist/", }, "./utils/timezone/../../index", [], ], }, { name: "backtracking target folder #1 (wildcard)", expect: ["./dist/timezone/../../index"], suite: [ { "./utils/*": "./dist/*", }, "./utils/timezone/../../index", [], ], }, { name: "backtracking target folder #2", expect: ["./dist/timezone/../index"], suite: [ { "./utils/": "./dist/", }, "./utils/timezone/../index", [], ], }, { name: "backtracking target folder #2 (wildcard)", expect: ["./dist/timezone/../index"], suite: [ { "./utils/*": "./dist/*", }, "./utils/timezone/../index", [], ], }, { name: "backtracking target folder #3", expect: ["./dist/target/../../index"], suite: [ { "./utils/": "./dist/target/", }, "./utils/../../index", [], ], }, { name: "backtracking target folder #3 (wildcard)", expect: ["./dist/target/../../index"], suite: [ { "./utils/*": "./dist/target/*", }, "./utils/../../index", [], ], }, // #endregion // #region Exports targets cannot map into a nested node_modules path { name: "nested node_modules path #1", expect: ["./node_modules/lodash/dist/index.js"], // we don't handle node_modules here suite: [ { "./utils/": { browser: "./node_modules/", }, }, "./utils/lodash/dist/index.js", ["browser"], ], }, { name: "nested node_modules path #1 (wildcard)", expect: ["./node_modules/lodash/dist/index.js"], // we don't handle node_modules here suite: [ { "./utils/*": { browser: "./node_modules/*", }, }, "./utils/lodash/dist/index.js", ["browser"], ], }, { name: "nested node_modules path #2", expect: ["./utils/../node_modules/lodash/dist/index.js"], suite: [ { "./utils/": "./utils/../node_modules/", }, "./utils/lodash/dist/index.js", [], ], }, { name: "nested node_modules path #2 (wildcard)", expect: ["./utils/../node_modules/lodash/dist/index.js"], suite: [ { "./utils/*": "./utils/../node_modules/*", }, "./utils/lodash/dist/index.js", [], ], }, // #endregion // #region Nested mapping { name: "nested mapping #1", expect: [], suite: [ { "./utils/": { browser: { webpack: "./", default: { node: "./node/", }, }, }, }, "./utils/index.js", ["browser"], ], }, { name: "nested mapping #1 (wildcard)", expect: [], suite: [ { "./utils/*": { browser: { webpack: "./*", default: { node: "./node/*", }, }, }, }, "./utils/index.js", ["browser"], ], }, { name: "nested mapping #2", expect: ["./index.js", "./node/index.js"], suite: [ { "./utils/": { browser: { webpack: ["./", "./node/"], default: { node: "./node/", }, }, }, }, "./utils/index.js", ["browser", "webpack"], ], }, { name: "nested mapping #2 (wildcard)", expect: ["./index.js", "./node/index.js"], suite: [ { "./utils/*": { browser: { webpack: ["./*", "./node/*"], default: { node: "./node/*", }, }, }, }, "./utils/index.js", ["browser", "webpack"], ], }, { name: "nested mapping #3", expect: [], // no browser condition name suite: [ { "./utils/": { browser: { webpack: ["./", "./node/"], default: { node: "./node/", }, }, }, }, "./utils/index.js", ["webpack"], ], }, { name: "nested mapping #3 (wildcard)", expect: [], // no browser condition name suite: [ { "./utils/*": { browser: { webpack: ["./*", "./node/*"], default: { node: "./node/*", }, }, }, }, "./utils/index.js", ["webpack"], ], }, { name: "nested mapping #4", expect: ["./node/index.js"], suite: [ { "./utils/": { browser: { webpack: ["./", "./node/"], default: { node: "./node/", }, }, }, }, "./utils/index.js", ["node", "browser"], ], }, { name: "nested mapping #4 (wildcard)", expect: ["./node/index.js"], suite: [ { "./utils/*": { browser: { webpack: ["./*", "./node/*"], default: { node: "./node/*", }, }, }, }, "./utils/index.js", ["node", "browser"], ], }, { name: "nested mapping #5", expect: [], suite: [ { "./utils/": { browser: { webpack: ["./", "./node/"], default: { node: { webpack: ["./wpck/"], }, }, }, }, }, "./utils/index.js", ["browser", "node"], ], }, { name: "nested mapping #5 (wildcard)", expect: [], suite: [ { "./utils/*": { browser: { webpack: ["./*", "./node/*"], default: { node: { webpack: ["./wpck/*"], }, }, }, }, }, "./utils/index.js", ["browser", "node"], ], }, { name: "nested mapping #6", expect: ["./index.js", "./node/index.js"], suite: [ { "./utils/": { browser: { webpack: ["./", "./node/"], default: { node: { webpack: ["./wpck/"], }, }, }, }, }, "./utils/index.js", ["browser", "node", "webpack"], ], }, { name: "nested mapping #6 (wildcard)", expect: ["./index.js", "./node/index.js"], suite: [ { "./utils/*": { browser: { webpack: ["./*", "./node/*"], default: { node: { webpack: ["./wpck/*"], }, }, }, }, }, "./utils/index.js", ["browser", "node", "webpack"], ], }, { name: "nested mapping #7", expect: ["./y.js"], suite: [ { "./a.js": { abc: { def: "./x.js" }, ghi: "./y.js", }, }, "./a.js", ["abc", "ghi"], ], }, { name: "nested mapping #8", expect: [], suite: [ { "./a.js": { abc: { def: "./x.js", default: [] }, ghi: "./y.js", }, }, "./a.js", ["abc", "ghi"], ], }, // #endregion // #region Syntax sugar { name: "syntax sugar #1", expect: ["./main.js"], suite: ["./main.js", ".", []], }, { name: "syntax sugar #2", expect: [], suite: ["./main.js", "./lib.js", []], }, { name: "syntax sugar #3", expect: ["./a.js", "./b.js"], suite: [["./a.js", "./b.js"], ".", []], }, { name: "syntax sugar #4", expect: [], suite: [["./a.js", "./b.js"], "./lib.js", []], }, { name: "syntax sugar #5", expect: ["./index.js"], suite: [ { browser: { default: "./index.js", }, }, ".", ["browser"], ], }, { name: "syntax sugar #6", expect: [], suite: [ { browser: { default: "./index.js", }, }, "./lib.js", ["browser"], ], }, { name: "syntax sugar #7", expect: new Error( 'Exports field key should be relative path and start with "." (key: "browser")', ), suite: [ { "./node": "./node.js", browser: { default: "./index.js", }, }, ".", ["browser"], ], }, { name: "syntax sugar #8", expect: new Error( 'Exports field key should be relative path and start with "." (key: "browser")', ), suite: [ { browser: { default: "./index.js", }, "./node": "./node.js", }, ".", ["browser"], ], }, // #endregion // #region Wildcards { name: "wildcard longest #1", expect: ["./abc/d"], suite: [ { "./ab*": "./ab/*", "./abc*": "./abc/*", "./a*": "./a/*", }, "./abcd", ["browser"], ], }, { name: "wildcard longest #2", expect: ["./abc/d/e"], suite: [ { "./ab*": "./ab/*", "./abc*": "./abc/*", "./a*": "./a/*", }, "./abcd/e", ["browser"], ], }, { name: "wildcard longest #3", expect: ["./abc/d"], suite: [ { "./x/ab*": "./ab/*", "./x/abc*": "./abc/*", "./x/a*": "./a/*", }, "./x/abcd", ["browser"], ], }, { name: "wildcard longest #4", expect: ["./abc/d/e"], suite: [ { "./x/ab*": "./ab/*", "./x/abc*": "./abc/*", "./x/a*": "./a/*", }, "./x/abcd/e", ["browser"], ], }, // #endregion { name: "path tree edge case #1", expect: ["./A/b/d.js"], suite: [ { "./a/": "./A/", "./a/b/c": "./c.js", }, "./a/b/d.js", [], ], }, { name: "path tree edge case #1 (wildcard)", expect: ["./A/b/d.js"], suite: [ { "./a/*": "./A/*", "./a/b/c": "./c.js", }, "./a/b/d.js", [], ], }, { name: "path tree edge case #2", expect: ["./A/c.js"], suite: [ { "./a/": "./A/", "./a/b": "./b.js", }, "./a/c.js", [], ], }, { name: "path tree edge case #2 (wildcard)", expect: ["./A/c.js"], suite: [ { "./a/*": "./A/*", "./a/b": "./b.js", }, "./a/c.js", [], ], }, { name: "path tree edge case #3", expect: ["./A/b/d/c.js"], suite: [ { "./a/": "./A/", "./a/b/c/d": "./c.js", }, "./a/b/d/c.js", [], ], }, { name: "path tree edge case #3 (wildcard)", expect: ["./A/b/d/c.js"], suite: [ { "./a/*": "./A/*", "./a/b/c/d": "./c.js", }, "./a/b/d/c.js", [], ], }, { name: "wildcard pattern #1", expect: ["./A/b.js"], suite: [ { "./a/*.js": "./A/*.js", }, "./a/b.js", [], ], }, { name: "wildcard pattern #2", expect: ["./A/b/c.js"], suite: [ { "./a/*.js": "./A/*.js", }, "./a/b/c.js", [], ], }, { name: "wildcard pattern #3", expect: ["./A/b/c.js"], suite: [ { "./a/*/c.js": "./A/*/c.js", }, "./a/b/c.js", [], ], }, { name: "wildcard pattern #4", expect: ["./A/b/b.js"], suite: [ { "./a/*/c.js": "./A/*/*.js", }, "./a/b/c.js", [], ], }, { name: "wildcard pattern #5", expect: ["./browser/index.js"], suite: [ { "./lib/*": { browser: ["./browser/*"], }, "./dist/*.js": { node: "./*.js", default: "./browser/*.js", }, }, "./dist/index.js", ["browser"], ], }, { name: "wildcard pattern #5", expect: ["./browser/index.js"], suite: [ { "./lib/*": { browser: ["./browser/*"], }, "./dist/*.js": { node: "./*.js", default: "./browser/*.js", }, }, "./lib/index.js", ["browser"], ], }, { name: "wildcard pattern #6", expect: ["./browser/foo/bar.js"], suite: [ { "./lib/*/bar.js": { browser: ["./browser/*/bar.js"], }, "./dist/*/bar.js": { node: "./*.js", default: "./browser/*.js", }, }, "./lib/foo/bar.js", ["browser"], ], }, { name: "wildcard pattern #6", expect: ["./browser/foo.js"], suite: [ { "./lib/*/bar.js": { browser: ["./browser/*/bar.js"], }, "./dist/*/bar.js": { node: "./*.js", default: "./browser/*.js", }, }, "./dist/foo/bar.js", ["browser"], ], }, { name: "wildcard pattern #7", expect: ["./browser/foo/default.js"], suite: [ { "./lib/*/bar.js": { browser: ["./browser/*/bar.js"], }, "./dist/*/bar.js": { node: "./*.js", default: "./browser/*/default.js", }, }, "./dist/foo/bar.js", ["default"], ], }, { name: "wildcard pattern #8", expect: ["./A/b/b/b.js"], suite: [ { "./a/*/c.js": "./A/*/*/*.js", }, "./a/b/c.js", [], ], }, { name: "wildcard pattern #9", expect: ["./A/b/b/b.js", "./B/b/b/b.js"], suite: [ { "./a/*/c.js": ["./A/*/*/*.js", "./B/*/*/*.js"], }, "./a/b/c.js", [], ], }, { name: "wildcard pattern #10", expect: ["./A/b/b/b.js"], suite: [ { "./a/foo-*/c.js": "./A/*/*/*.js", }, "./a/foo-b/c.js", [], ], }, { name: "wildcard pattern #11", expect: ["./A/b/b/b.js"], suite: [ { "./a/*-foo/c.js": "./A/*/*/*.js", }, "./a/b-foo/c.js", [], ], }, { name: "wildcard pattern #12", expect: ["./A/b/b/b.js"], suite: [ { "./a/foo-*-foo/c.js": "./A/*/*/*.js", }, "./a/foo-b-foo/c.js", [], ], }, { name: "wildcard pattern #13", expect: ["./A/b/c/d.js"], suite: [ { "./a/foo-*-foo/c.js": "./A/b/c/d.js", }, "./a/foo-b-foo/c.js", [], ], }, { name: "wildcard pattern #13", expect: ["./A/b/c/*.js"], suite: [ { "./a/foo-foo/c.js": "./A/b/c/*.js", }, "./a/foo-foo/c.js", [], ], }, ]; for (const testCase of testCases) { it(testCase.name, () => { if (testCase.expect instanceof Error) { const { message } = testCase.expect; assert.throws( () => processExportsField(testCase.suite[0])( testCase.suite[1], new Set(testCase.suite[2]), ), (err) => err instanceof Error && err.message.includes(message), ); } else { assert.deepStrictEqual( processExportsField(testCase.suite[0])( testCase.suite[1], new Set(testCase.suite[2]), )[0], testCase.expect, ); } }); } }); describe("exportsFieldPlugin", () => { const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["webpack"], }); const commonjsResolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, conditionNames: ["webpack"], }); it("resolve root using exports field, not a main field", (t, done) => { resolver.resolve({}, fixture, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/exports-field/x.js"), ); done(); }); }); it("resolve using exports field, not a browser field #1", (t, done) => { const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], conditionNames: ["custom"], extensions: [".js"], fileSystem: nodeFileSystem, }); resolver.resolve( {}, fixture, "exports-field/dist/main.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/exports-field/lib/lib2/main.js"), ); done(); }, ); }); it("resolve using exports field and a browser alias field #2", (t, done) => { const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], conditionNames: ["node"], extensions: [".js"], fileSystem: nodeFileSystem, }); resolver.resolve( {}, fixture2, "exports-field/dist/main.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture2, "node_modules/exports-field/lib/browser.js"), ); done(); }, ); }); it("throw error if extension not provided", (t, done) => { resolver.resolve( {}, fixture2, "exports-field/dist/main", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); // exports field maps ./dist/main -> ./lib/main, but ./lib/main (no ext) doesn't exist. // Resolution stops at the exports field level with a "Package path" error // (no fallback to parent node_modules per issue #399 fix). assert.match(err.message, /Package path/); done(); }, ); }); it("throw error if extension not provided #2", (t, done) => { resolver.resolve( {}, fixture2, "exports-field/dist/main", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Package path/); done(); }, ); }); it("should resolve extension without fullySpecified", (t, done) => { commonjsResolver.resolve( {}, fixture2, "exports-field/dist/main", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture2, "node_modules/exports-field/lib/main.js"), ); done(); }, ); }); it("resolver should respect condition names", (t, done) => { resolver.resolve( {}, fixture, "exports-field/dist/main.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/exports-field/lib/main.js"), ); done(); }, ); }); it("resolver should respect fallback", (t, done) => { resolver.resolve( {}, fixture2, "exports-field/dist/browser.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture2, "node_modules/exports-field/lib/browser.js"), ); done(); }, ); }); it("resolver should respect query parameters #1", (t, done) => { resolver.resolve( {}, fixture2, "exports-field/dist/browser.js?foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve( fixture2, "node_modules/exports-field/lib/browser.js?foo", ), ); done(); }, ); }); it("resolver should respect query parameters #2. Direct matching", (t, done) => { resolver.resolve({}, fixture2, "exports-field?foo", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /"\.\/\?foo" is not exported/); done(); }); }); it("resolver should respect fragment parameters #1", (t, done) => { resolver.resolve( {}, fixture2, "exports-field/dist/browser.js#foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve( fixture2, "node_modules/exports-field/lib/browser.js#foo", ), ); done(); }, ); }); it("resolver should respect fragment parameters #2. Direct matching", (t, done) => { resolver.resolve({}, fixture2, "exports-field#foo", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /"\.\/#foo" is not exported/); done(); }); }); it("resolver should respect query and fragment parameters together", (t, done) => { resolver.resolve( {}, fixture2, "exports-field/dist/browser.js?foo=bar#frag", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve( fixture2, "node_modules/exports-field/lib/browser.js?foo=bar#frag", ), ); done(); }, ); }); it("relative path should work, if relative path as request is used", (t, done) => { resolver.resolve( {}, fixture, "./node_modules/exports-field/lib/main.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/exports-field/lib/main.js"), ); done(); }, ); }); it("relative path should not work with exports field", (t, done) => { resolver.resolve( {}, fixture, "./node_modules/exports-field/dist/main.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve/); done(); }, ); }); it("backtracking should not work for request", (t, done) => { resolver.resolve( {}, fixture, "exports-field/dist/../../../a.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\/lib\/lib2\/\.\.\/\.\.\/\.\.\/a\.js" defined for "\.\/dist\/"/, ); done(); }, ); }); it("backtracking should not work for exports field target", (t, done) => { resolver.resolve( {}, fixture, "exports-field/dist/a.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\/\.\.\/\.\.\/a\.js" defined for "\.\/dist\/a\.js"/, ); done(); }, ); }); it("self-resolving root", (t, done) => { resolver.resolve({}, fixture, "@exports-field/core", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "./a.js")); done(); }); }); it("not exported error", (t, done) => { resolver.resolve( {}, fixture, "exports-field/anything/else", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /not exported under the condition "webpack" from package/, ); done(); }, ); }); it("field name path #1", (t, done) => { const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], exportsFields: [["exportsField", "exports"]], extensions: [".js"], fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture3, "node_modules/exports-field/main.js"), ); done(); }); }); it("field name path #2", (t, done) => { const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], exportsFields: [["exportsField", "exports"], "exports"], extensions: [".js"], fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture3, "node_modules/exports-field/main.js"), ); done(); }); }); it("field name path #3", (t, done) => { const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], exportsFields: ["exports", ["exportsField", "exports"]], extensions: [".js"], fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture3, "node_modules/exports-field/main.js"), ); done(); }); }); it("field name path #4", (t, done) => { const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], exportsFields: [["exports"]], extensions: [".js"], fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture2, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture2, "node_modules/exports-field/index.js"), ); done(); }); }); it("field name path #5", (t, done) => { const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], exportsFields: ["ex", ["exportsField", "exports"]], extensions: [".js"], fileSystem: nodeFileSystem, }); resolver.resolve({}, fixture3, "exports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture3, "node_modules/exports-field/index"), ); done(); }); }); it("request ending with slash #1", (t, done) => { resolver.resolve({}, fixture, "exports-field/", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Resolving to directories is not possible/); done(); }); }); it("request ending with slash #2", (t, done) => { resolver.resolve({}, fixture, "exports-field/dist/", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Resolving to directories is not possible/); done(); }); }); it("request ending with slash #3", (t, done) => { resolver.resolve({}, fixture, "exports-field/lib/", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Resolving to directories is not possible/); done(); }); }); it("should throw error if target is invalid", (t, done) => { resolver.resolve({}, fixture4, "exports-field", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\/a\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\."/, ); done(); }); }); it("throw error if exports field is invalid", (t, done) => { resolver.resolve( {}, fixture, "invalid-exports-field", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /should be relative path/); assert.match(err.message, /umd/); done(); }, ); }); it("should log the correct info", (t, done) => { const log = []; resolver.resolve( {}, fixture, "exports-field/dist/browser.js", { log: (v) => log.push(v) }, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/exports-field/lib/browser.js"), ); assert.deepStrictEqual( log.map((line) => line.replace(fixture, "...").replace(/\\/g, "/")), [ "resolve 'exports-field/dist/browser.js' in '...'", " Parsed request is a module", " using description file: .../package.json (relative path: .)", " resolve as module", " looking for modules in .../node_modules", " existing directory .../node_modules/exports-field", " using description file: .../node_modules/exports-field/package.json (relative path: .)", " using exports field: ./lib/browser.js", " using description file: .../node_modules/exports-field/package.json (relative path: ./lib/browser.js)", " existing file: .../node_modules/exports-field/lib/browser.js", " reporting result .../node_modules/exports-field/lib/browser.js", ], ); done(); }, ); }); it("should resolve with wildcard pattern #1", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/features/f.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/features/f.js"), ); done(); }); }); it("should resolve with wildcard pattern #2", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/features/y/y.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/features/y/y.js"), ); done(); }); }); it("should resolve with wildcard pattern #3", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/features/y/y.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/features/y/y.js"), ); done(); }); }); it("should resolve with wildcard pattern #4", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve( {}, fixture, "m/features-no-ext/y/y.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/features/y/y.js"), ); done(); }, ); }); it("should resolve with wildcard pattern #5", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle/nested/f.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/middle/nested/f.js"), ); done(); }); }); it("should resolve with wildcard pattern #6", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve( {}, fixture, "m/middle-1/nested/f.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/middle-1/nested/f.js"), ); done(); }, ); }); it("should resolve with wildcard pattern #7", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve( {}, fixture, "m/middle-2/nested/f.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/middle-2/nested/f.js"), ); done(); }, ); }); it("should resolve with wildcard pattern #8", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle-3/nested/f", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve( fixture, "./node_modules/m/src/middle-3/nested/f/nested/f.js", ), ); done(); }); }); it("should resolve with wildcard pattern #9", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle-4/f/nested", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/middle-4/f/f.js"), ); done(); }); }); it("should resolve with wildcard pattern #10", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve({}, fixture, "m/middle-5/f$/$", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/m/src/middle-5/f$/$.js"), ); done(); }); }); it("should throw error if target is 'null'", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/", ); resolver.resolve( {}, fixture, "m/features/internal/file.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /"\.\/features\/internal\/file\.js" is not exported/, ); done(); }, ); }); it("should resolve with the `extensionAlias` option", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { ".js": [".ts", ".js"], }, fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "@org/pkg/string.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/@org/pkg/dist/string.js"), ); done(); }); }); it("should resolve with the `extensionAlias` option #2", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { ".js": [".ts", ".js"], }, fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/pkg/dist/string.js"), ); done(); }); }); it("should resolve with the `extensionAlias` option #3", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { ".js": [".foo", ".baz", ".baz", ".ts", ".js"], }, fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/pkg/dist/string.js"), ); done(); }); }); it("should throw error with the `extensionAlias` option", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { ".js": [".ts"], }, fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /"\.\/string\.ts" is not exported/); done(); }); }); it("should throw error with the `extensionAlias` option #2", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { ".js": ".ts", }, fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["webpack", "default"], }); const fixture = path.resolve( __dirname, "./fixtures/exports-field-and-extension-alias/", ); resolver.resolve({}, fixture, "pkg/string.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /"\.\/string\.ts" is not exported/); done(); }); }); it("invalid package target #1", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.strictEqual( result, `${path.resolve(fixture5, "./a.js")}?foo=../`, ); done(); }, ); }); it("invalid package target #2", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/foo/file.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.strictEqual( result, `${path.resolve(fixture5, "./a.js")}?foo=../#../`, ); done(); }, ); }); it("invalid package target #3", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/bar", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "-bad-specifier-" defined for "\.\/bar"/, ); done(); }, ); }); it("invalid package target #4", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/baz-multi", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "foo" defined for "\.\/baz-multi"/, ); done(); }, ); }); it("invalid package target #5", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/pattern/a.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture5, "./a.js")); done(); }, ); }); it("invalid package target #6", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/slash", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture5, "./a.js")); done(); }, ); }); it("invalid package target #7", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/no-slash", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture5, "./a.js")); done(); }, ); }); it("invalid package target #8", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/utils/index.mjs", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\/b\/index\.mjs" defined for "\.\/utils\//, ); done(); }, ); }); it("invalid package target #9", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/utils1/index.mjs", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\/a\/index.mjs" defined for "\.\/utils1\/"/, ); done(); }, ); }); it("invalid package target #10", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/utils2/index", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\.\/this\/index" defined for "\.\/utils2\/"/, ); done(); }, ); }); it("invalid package target #11", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/utils3/index", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\.\/this\/index" defined for "\.\/utils3\/\*"/, ); done(); }, ); }); it("invalid package target #12", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/utils4/index", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\.\/src\/index" defined for "\.\/utils4\/\*"/, ); done(); }, ); }); it("invalid package target #13", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/utils5/index", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\.\/src\/index" defined for "\.\/utils5\/"/, ); done(); }, ); }); it("invalid package target #14", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/timezones/pdt.mjs", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\." defined for "\.\/\*"/, ); done(); }, ); }); it("invalid package target #15", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/non-existent.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); // exports maps ./non-existent.js -> ["-bad-specifier-", "./non-existent.js", "./a.js"] // The first valid target (./non-existent.js) doesn't exist, so the paths array is // abandoned (issue #400) and resolution fails with a "Package path" error // (no fallback to parent node_modules per issue #399 fix). assert.match( err.message, /Package path \.\/non-existent\.js.*no valid target file was found/, ); done(); }, ); }); it("invalid package target #16", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/dep/multi1", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\.\/\.\.\/test\/foo" defined for "\.\/dep\/multi1"/, ); done(); }, ); }); it("invalid package target #17", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/dep/multi2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\.\/\.\.\/test" defined for "\.\/dep\/multi2"/, ); done(); }, ); }); it("invalid package target #18", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/dep/multi4", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\/c\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\.\/dep\/multi4"/, ); done(); }, ); }); it("invalid package target #19", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/dep/multi5", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "exports" target "\.\/a\/\.\.\/b\/\.\.\/\.\.\/pack1\/index\.js" defined for "\.\/dep\/multi5"/, ); done(); }, ); }); it("should resolve the valid thing in array of export #1", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/bad-specifier.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture5, "./a.js")); done(); }, ); }); it("should resolve the valid thing in array of export #2", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/bad-specifier1.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture5, "./a.js")); done(); }, ); }); it("should resolve the valid thing in array of export #3", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/dep/multi", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture5, "./a.js")); done(); }, ); }); it("should resolve the valid thing in array of export #4", (t, done) => { resolver.resolve( {}, fixture5, "@exports-field/bad-specifier/dep/multi3", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture5, "./a.js")); done(); }, ); }); // issue #399: nested same package with different versions // When workspace/node_modules/pkg has an exports field mapping ./src/index.js -> ./dist/index.js // but ./dist/index.js does NOT exist, resolution should fail with an error // and must NOT fall back to the root node_modules/pkg version. it("should not fall back to parent node_modules when exports field maps to a missing file (issue #399)", (t, done) => { const nestedResolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: new CachedInputFileSystem(fs, 4000), conditionNames: ["node"], fullySpecified: true, }); nestedResolver.resolve( {}, path.resolve(fixture6, "workspace"), "pkg/src/index.js", {}, (err, result) => { if (!err) { return done( new Error( `Expected resolution to fail, but got: ${result}. ` + "Should not fall back to root node_modules when workspace's exports field maps to a missing file.", ), ); } assert.ok(err instanceof Error); done(); }, ); }); it("emits 'is not exported' error when no conditions match", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], conditionNames: ["unknown-cond"], exportsFields: ["exports"], fileSystem: nodeFileSystem, }); resolver.resolve( {}, path.join(path.join(__dirname, "fixtures"), "exports-field"), "exports-field/index", {}, (err) => { assert.ok(err instanceof Error); done(); }, ); }); }); webpack-enhanced-resolve-7dfc9bc/test/extension-alias.test.js000066400000000000000000000175461523262174200245500ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const ResolverFactory = require("../lib/ResolverFactory"); const { describe, it } = require("./_runner"); /** @typedef {import("../lib/util/entrypoints").ImportsField} ImportsField */ describe("extension-alias", () => { const fixture = path.resolve(__dirname, "fixtures", "extension-alias"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFiles: ["index.js"], extensionAlias: { ".js": [".ts", ".js"], ".mjs": ".mts", }, }); it("should alias fully specified file", (t, done) => { resolver.resolve({}, fixture, "./index.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "index.ts")); done(); }); }); it("should alias fully specified file when there are two alternatives", (t, done) => { resolver.resolve({}, fixture, "./dir/index.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "dir", "index.ts")); done(); }); }); it("should also allow the second alternative", (t, done) => { resolver.resolve({}, fixture, "./dir2/index.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "dir2", "index.js")); done(); }); }); it("should support alias option without an array", (t, done) => { resolver.resolve({}, fixture, "./dir2/index.mjs", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "dir2", "index.mts"), ); done(); }); }); it("should not allow to fallback to the original extension or add extensions", (t, done) => { resolver.resolve({}, fixture, "./index.mjs", {}, (err, _result) => { assert.ok(err instanceof Error); done(); }); }); describe("fallback to the original request", () => { it("should resolve a directory whose name ends with the aliased extension", (t, done) => { resolver.resolve({}, fixture, "./dir3.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "dir3.js", "index.js"), ); done(); }); }); it("should resolve a package whose name ends with the aliased extension behind an alias", (t, done) => { const aliasResolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFields: ["main"], mainFiles: ["index"], modules: ["node_modules"], alias: { vendor: path.resolve(fixture, "node_modules") }, extensionAlias: { ".js": [".ts", ".js"] }, }); aliasResolver.resolve({}, fixture, "vendor/pkg.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules", "pkg.js", "dist", "main.js"), ); done(); }); }); it("should not fall back when the original extension is not an alias", (t, done) => { const strictResolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFiles: ["index.js"], extensionAlias: { ".js": [".ts"] }, }); strictResolver.resolve({}, fixture, "./dir3.js", {}, (err, _result) => { assert.ok(err instanceof Error); done(); }); }); }); it("should try multiple extension aliases in order and logs each failure", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensionAlias: { ".js": [".missing1", ".missing2", ".js"] }, }); const log = []; resolver.resolve( {}, path.join(__dirname, "fixtures"), "./a.js", { log: (m) => log.push(m) }, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.join(path.join(__dirname, "fixtures"), "a.js"), ); assert.strictEqual( log.some((l) => l.includes("Failed to alias from extension alias")), true, ); done(); }, ); }); describe("imports field", () => { const importsFixture = path.resolve( __dirname, "fixtures", "imports-field-extension-alias", ); it("should apply extension alias to paths resolved via imports field", (t, done) => { resolver.resolve({}, importsFixture, "#foo", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(importsFixture, "foo.ts")); done(); }); }); it("should fall back to later alternatives when first alias does not exist", (t, done) => { resolver.resolve({}, importsFixture, "#bar", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(importsFixture, "bar.js")); done(); }); }); it("should support single-string alias (no array) via imports field", (t, done) => { resolver.resolve({}, importsFixture, "#only", {}, (err, _result) => { // ".mjs": ".mts" is a strict mapping with no fallback, so this // should error because only.mts does not exist assert.ok(err instanceof Error); done(); }); }); it("should not fall back to the original extension via imports field (strict alias)", (t, done) => { const strictResolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, extensionAlias: { ".js": [".ts"] }, }); strictResolver.resolve({}, importsFixture, "#bar", {}, (err, _result) => { // bar.ts does not exist and we explicitly disallow fallback assert.ok(err instanceof Error); done(); }); }); }); describe("exports field (extensionAliasForExports)", () => { const exportsFixture = path.resolve( __dirname, "fixtures", "exports-field-extension-alias-opt-in", ); it("should not apply extension alias to exports-field targets by default (Node.js-aligned)", (t, done) => { const defaultResolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { ".js": [".ts", ".js"] }, fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["default"], }); defaultResolver.resolve( {}, exportsFixture, "pkg/string.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(exportsFixture, "./node_modules/pkg/dist/string.js"), ); done(); }, ); }); it("should prefer the TS source over the exports-declared JS target when the option is enabled", (t, done) => { const tsResolver = ResolverFactory.createResolver({ extensions: [".js"], extensionAlias: { ".js": [".ts", ".js"] }, extensionAliasForExports: true, fileSystem: nodeFileSystem, fullySpecified: true, conditionNames: ["default"], }); tsResolver.resolve( {}, exportsFixture, "pkg/string.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(exportsFixture, "./node_modules/pkg/dist/string.ts"), ); done(); }, ); }); }); describe("should not apply extension alias to extensions or mainFiles field", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFiles: ["index.js"], extensionAlias: { ".js": [], }, }); it("directory", (t, done) => { resolver.resolve({}, fixture, "./dir2", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "dir2", "index.js"), ); done(); }); }); it("file", (t, done) => { resolver.resolve({}, fixture, "./dir2/index", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "dir2", "index.js"), ); done(); }); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/extensions.test.js000066400000000000000000000067721523262174200236430ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".ts", ".js"], fileSystem: nodeFileSystem, }); const resolver2 = ResolverFactory.createResolver({ extensions: [".ts", "", ".js"], fileSystem: nodeFileSystem, }); const resolver3 = ResolverFactory.createResolver({ extensions: [".ts", "", ".js"], enforceExtension: false, fileSystem: nodeFileSystem, }); const fixture = path.resolve(__dirname, "fixtures", "extensions"); describe("extensions", () => { it("should resolve according to order of provided extensions", (t, done) => { resolver.resolve({}, fixture, "./foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "foo.ts")); done(); }); }); it("should resolve according to order of provided extensions (dir index)", (t, done) => { resolver.resolve({}, fixture, "./dir", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "dir/index.ts")); done(); }); }); it("should resolve according to main field in module root", (t, done) => { resolver.resolve({}, fixture, ".", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "index.js")); done(); }); }); it("should resolve single file module before directory", (t, done) => { resolver.resolve({}, fixture, "module", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/module.js"), ); done(); }); }); it("should resolve trailing slash directory before single file", (t, done) => { resolver.resolve({}, fixture, "module/", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/module/index.ts"), ); done(); }); }); it("should not resolve to file when request has a trailing slash (relative)", (t, done) => { resolver.resolve({}, fixture, "./foo.js/", {}, (err, _result) => { if (!err) return done(new Error("No error")); assert.ok(err instanceof Error); done(); }); }); it("should not resolve to file when request has a trailing slash (module)", (t, done) => { resolver.resolve({}, fixture, "module.js/", {}, (err, _result) => { if (!err) return done(new Error("No error")); assert.ok(err instanceof Error); done(); }); }); it("should default enforceExtension to true when extensions includes an empty string", (t, done) => { const missingDependencies = new Set(); resolver2.resolve({}, fixture, "./foo", { missingDependencies }, () => { assert.ok(!missingDependencies.has(path.resolve(fixture, "foo"))); done(); }); }); it("should respect enforceExtension when extensions includes an empty string", (t, done) => { const missingDependencies = new Set(); resolver3.resolve({}, fixture, "./foo", { missingDependencies }, () => { assert.ok(missingDependencies.has(path.resolve(fixture, "foo"))); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/fallback.test.js000066400000000000000000000122601523262174200231700ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { Volume } = require("memfs"); const { ResolverFactory } = require("../"); const { beforeEach, describe, it } = require("./_runner"); describe("fallback", () => { let resolver; beforeEach(() => { const fileSystem = Volume.fromJSON( { "/a/index": "", "/a/dir/index": "", "/recursive/index": "", "/recursive/dir/index": "", "/recursive/dir/file": "", "/recursive/dir/dir/index": "", "/b/index": "", "/b/dir/index": "", "/c/index": "", "/c/dir/index": "", "/d/index.js": "", "/d/dir/.empty": "", "/e/index": "", "/e/anotherDir/index": "", "/e/dir/file": "", }, "/", ); resolver = ResolverFactory.createResolver({ fallback: { aliasA: "a", b$: "a/index", c$: "/a/index", multiAlias: ["b", "c", "d", "e", "a"], recursive: "recursive/dir", "/d/dir": "/c/dir", "/d/index.js": "/c/index", ignored: false, }, modules: "/", useSyncFileSystemCalls: true, // @ts-expect-error for test fileSystem, }); }); it("should resolve a not aliased module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "a"), "/a/index"); assert.strictEqual(resolver.resolveSync({}, "/", "a/index"), "/a/index"); assert.strictEqual(resolver.resolveSync({}, "/", "a/dir"), "/a/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "a/dir/index"), "/a/dir/index", ); }); it("should resolve an fallback module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "aliasA"), "/a/index"); assert.strictEqual( resolver.resolveSync({}, "/", "aliasA/index"), "/a/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "aliasA/dir"), "/a/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "aliasA/dir/index"), "/a/dir/index", ); }); it("should resolve an ignore module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "ignored"), false); }); it("should resolve a recursive aliased module", () => { assert.strictEqual( resolver.resolveSync({}, "/", "recursive"), "/recursive/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "recursive/index"), "/recursive/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "recursive/dir"), "/recursive/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "recursive/dir/index"), "/recursive/dir/index", ); assert.strictEqual( resolver.resolveSync({}, "/", "recursive/file"), "/recursive/dir/file", ); }); it("should resolve a file aliased module with a query", () => { assert.strictEqual( resolver.resolveSync({}, "/", "b?query"), "/b/index?query", ); assert.strictEqual( resolver.resolveSync({}, "/", "c?query"), "/c/index?query", ); }); it("should resolve a path in a file aliased module", () => { assert.strictEqual(resolver.resolveSync({}, "/", "b/index"), "/b/index"); assert.strictEqual(resolver.resolveSync({}, "/", "b/dir"), "/b/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "b/dir/index"), "/b/dir/index", ); assert.strictEqual(resolver.resolveSync({}, "/", "c/index"), "/c/index"); assert.strictEqual(resolver.resolveSync({}, "/", "c/dir"), "/c/dir/index"); assert.strictEqual( resolver.resolveSync({}, "/", "c/dir/index"), "/c/dir/index", ); }); it("should resolve a file in multiple aliased dirs", () => { assert.strictEqual( resolver.resolveSync({}, "/", "multiAlias/dir/file"), "/e/dir/file", ); assert.strictEqual( resolver.resolveSync({}, "/", "multiAlias/anotherDir"), "/e/anotherDir/index", ); }); it("should log the correct info", (t, done) => { const log = []; resolver.resolve( {}, "/", "aliasA/dir", { log: (v) => log.push(v) }, (err, result) => { if (err) return done(err); assert.strictEqual(result, "/a/dir/index"); assert.deepStrictEqual(log, [ "resolve 'aliasA/dir' in '/'", " Parsed request is a module", " No description file found in / or above", " resolve as module", " looking for modules in /", " /aliasA doesn't exist", " aliased with mapping 'aliasA': 'a' to 'a/dir'", " Parsed request is a module", " No description file found in / or above", " resolve as module", " looking for modules in /", " existing directory /a", " No description file found in /a or above", " No description file found in /a or above", " no extension", " /a/dir is not a file", " .js", " /a/dir.js doesn't exist", " .json", " /a/dir.json doesn't exist", " .node", " /a/dir.node doesn't exist", " as directory", " existing directory /a/dir", " No description file found in /a/dir or above", " using path: /a/dir/index", " No description file found in /a/dir or above", " no extension", " existing file: /a/dir/index", " reporting result /a/dir/index", ]); done(); }, ); }); }); webpack-enhanced-resolve-7dfc9bc/test/file-url-options.test.js000066400000000000000000000237271523262174200246530ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { fileURLToPath, pathToFileURL } = require("url"); const enhancedResolve = require("../lib"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const ResolverFactory = require("../lib/ResolverFactory"); const { toPath } = require("../lib/util/path"); const { describe, it } = require("./_runner"); describe("file: URL path options", () => { const fixtures = path.resolve(__dirname, "fixtures"); const modulesDir = path.resolve(fixtures, "node_modules"); const fileSystem = new CachedInputFileSystem(fs, 4000); const makeResolver = (options) => ResolverFactory.createResolver({ extensions: [".js"], fileSystem, ...options, }); describe("roots", () => { it("should accept a URL instance", (t, done) => { const resolver = makeResolver({ roots: [pathToFileURL(fixtures)] }); resolver.resolve({}, fixtures, "/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); }); describe("modules", () => { it("should accept a URL instance", (t, done) => { const resolver = makeResolver({ modules: [pathToFileURL(modulesDir)] }); resolver.resolve({}, fixtures, "m1/a", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(modulesDir, "m1/a.js")); done(); }); }); it("should accept a single URL instance", (t, done) => { const resolver = makeResolver({ modules: pathToFileURL(modulesDir) }); resolver.resolve({}, fixtures, "m1/a", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(modulesDir, "m1/a.js")); done(); }); }); it("should keep folder-name entries untouched", (t, done) => { const resolver = makeResolver({ modules: ["node_modules"] }); resolver.resolve({}, fixtures, "m1/a", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(modulesDir, "m1/a.js")); done(); }); }); }); describe("alias", () => { it("should accept a URL instance as the target", (t, done) => { const resolver = makeResolver({ alias: { "@": pathToFileURL(fixtures) }, }); resolver.resolve({}, fixtures, "@/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); it("should accept a URL instance in an array target", (t, done) => { const resolver = makeResolver({ alias: { "@": [pathToFileURL(modulesDir), pathToFileURL(fixtures)] }, }); resolver.resolve({}, fixtures, "@/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); it("should accept array-form entries with a URL target", (t, done) => { const resolver = makeResolver({ alias: [{ name: "@", alias: pathToFileURL(fixtures) }], }); resolver.resolve({}, fixtures, "@/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); // A `file:` string target is not converted here (strings stay literal), // but the rewritten request still resolves because the request side // (`parseIdentifier`) converts `file:` request strings. it("should still resolve a file: string target via request parsing", (t, done) => { const resolver = makeResolver({ alias: { "@": String(pathToFileURL(fixtures)) }, }); resolver.resolve({}, fixtures, "@/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); }); describe("restrictions", () => { it("should accept a URL instance", (t, done) => { const resolver = makeResolver({ restrictions: [pathToFileURL(fixtures)], }); resolver.resolve({}, fixtures, "./b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); it("should keep RegExp entries untouched", (t, done) => { const resolver = makeResolver({ restrictions: [/\.js$/] }); resolver.resolve({}, fixtures, "./b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); // A `file:` string restriction stays literal, so no real path is ever // "inside" it and resolution is blocked — use a URL instance or a path. it("should treat a file: string restriction as a literal path", (t, done) => { const resolver = makeResolver({ restrictions: [String(pathToFileURL(fixtures))], }); resolver.resolve({}, fixtures, "./b.js", {}, (err) => { assert.ok(err instanceof Error); done(); }); }); }); describe("tsconfig", () => { const tsconfigDir = path.resolve(fixtures, "tsconfig-paths", "base"); const tsconfigFile = path.join(tsconfigDir, "tsconfig.json"); it("should accept a URL instance as the config file", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: pathToFileURL(tsconfigFile), }); resolver.resolve( {}, tsconfigDir, "@components/button", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.join(tsconfigDir, "src", "components", "button.ts"), ); done(); }, ); }); it("should accept a URL instance as options.configFile", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: pathToFileURL(tsconfigFile) }, }); resolver.resolve( {}, tsconfigDir, "@components/button", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.join(tsconfigDir, "src", "components", "button.ts"), ); done(); }, ); }); }); describe("toPath", () => { it("should convert a file: URL instance to a path", () => { assert.strictEqual(toPath(pathToFileURL(modulesDir)), modulesDir); }); // A string is always a literal path (matches Node fs, nodejs/node#17658), // so a directory literally named `file:` is never mistaken for a URL. it("should leave strings untouched, including `file:`-prefixed ones", () => { assert.strictEqual(toPath("file:foo"), "file:foo"); assert.strictEqual(toPath("file:///abs"), "file:///abs"); assert.strictEqual(toPath(modulesDir), modulesDir); }); }); }); describe("file: URL resolve context and request", () => { const fixtures = path.resolve(__dirname, "fixtures"); const bFile = path.resolve(fixtures, "b.js"); const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem, }); describe("context (path) argument", () => { it("should accept a URL instance as the context path", (t, done) => { resolver.resolve( {}, pathToFileURL(fixtures), "./b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, bFile); done(); }, ); }); it("should accept a URL context when the context object is omitted", (t, done) => { resolver.resolve(pathToFileURL(fixtures), "./b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, bFile); done(); }); }); it("should still reject a non-string, non-URL context path", (t, done) => { // @ts-expect-error for tests resolver.resolve({}, 42, "./b.js", {}, (err) => { assert.ok(err instanceof Error); assert.match( /** @type {Error} */ (err).message, /path argument is not a string/, ); done(); }); }); }); describe("request argument", () => { it("should accept a file: URL instance as the request", (t, done) => { resolver.resolve( {}, fixtures, pathToFileURL(bFile), {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, bFile); done(); }, ); }); it("should still reject a non-string, non-URL request", (t, done) => { // @ts-expect-error for tests resolver.resolve({}, fixtures, 42, {}, (err) => { assert.ok(err instanceof Error); assert.match( /** @type {Error} */ (err).message, /request argument is not a string/, ); done(); }); }); }); // With both arguments as URL instances the pair mirrors `new URL(request, // context)` — request is the first param, context the base — so an absolute // `file:` request wins over the context base, exactly like the URL constructor. describe("both context and request as URL", () => { it("should resolve a URL request against a URL context like new URL()", (t, done) => { const contextURL = pathToFileURL(fixtures); const requestURL = pathToFileURL(bFile); resolver.resolve({}, contextURL, requestURL, {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, bFile); assert.deepStrictEqual( result, fileURLToPath(new URL(requestURL, contextURL)), ); done(); }); }); }); describe("high-level resolve API", () => { it("resolve should accept a URL context with the context object omitted", (t, done) => { enhancedResolve(pathToFileURL(fixtures), "./b.js", (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, bFile); done(); }); }); it("resolveSync should accept a URL context", () => { assert.deepStrictEqual( enhancedResolve.sync(pathToFileURL(fixtures), "./b.js"), bFile, ); }); it("resolvePromise should accept a URL context", async () => { assert.deepStrictEqual( await enhancedResolve.promise(pathToFileURL(fixtures), "./b.js"), bFile, ); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/fileURLToPath.test.js000066400000000000000000000071231523262174200240550ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const path = require("path"); const { pathToFileURL } = require("url"); const fileURLToPath = require("../lib/util/fileURLToPath"); const { describe, it } = require("./_runner"); describe("fileURLToPath", () => { // Expected values are pinned literals (computed once from Node's reference // `url.fileURLToPath`) rather than computed at test time: the `{ windows }` // option only exists on Node >= 20.13/22.1 and is ignored by Bun and older // runtimes, so calling the runtime's own `fileURLToPath` here would compare // against host-platform output and fail spuriously. const posixCases = [ ["file:///", "/"], ["file:///a/b/c", "/a/b/c"], ["file:///a%20b/c", "/a b/c"], ["file:///a/b%2Bc", "/a/b+c"], ["file:///with%23hash/file.js", "/with#hash/file.js"], ["file:///%E4%B8%AD%E6%96%87/x", "/中文/x"], ]; const windowsCases = [ ["file:///C:/foo", "C:\\foo"], ["file:///C:/a%20b/c", "C:\\a b\\c"], ["file:///c:/foo/bar.js", "c:\\foo\\bar.js"], ["file://server/share/file.js", "\\\\server\\share\\file.js"], ["file:///D:/%E4%B8%AD%E6%96%87/x", "D:\\中文\\x"], ]; describe("posix branch", () => { for (const [input, expected] of posixCases) { it(`converts ${input}`, () => { assert.strictEqual(fileURLToPath(input, { windows: false }), expected); }); } }); describe("windows branch", () => { for (const [input, expected] of windowsCases) { it(`converts ${input}`, () => { assert.strictEqual(fileURLToPath(input, { windows: true }), expected); }); } }); it("accepts a URL instance", () => { const url = new URL("file:///home/user/project"); assert.strictEqual( fileURLToPath(url, { windows: false }), "/home/user/project", ); }); it("round-trips pathToFileURL on the host platform", () => { // Build a host-absolute path so the round-trip is correct on Windows // (drive letter) as well as POSIX, using the host-default platform branch. const pth = path.resolve("a b", "c"); assert.strictEqual(fileURLToPath(pathToFileURL(pth)), pth); }); it("throws for a non-file: scheme", () => { assert.throws( () => fileURLToPath("http://example.com/x"), (err) => err instanceof Error && err.message.includes("scheme file"), ); }); it("throws for an encoded slash in the posix branch", () => { assert.throws( () => fileURLToPath("file:///a%2fb", { windows: false }), /encoded \/ characters/, ); }); it("throws for an encoded backslash in the windows branch", () => { assert.throws( () => fileURLToPath("file:///C:/a%5cb", { windows: true }), /encoded \\ or \/ characters/, ); }); it("throws for a non-absolute windows drive path", () => { assert.throws( () => fileURLToPath("file:///foo", { windows: true }), (err) => err instanceof Error && err.message.includes("must be absolute"), ); }); it("throws for a posix host that is not empty", () => { assert.throws( () => fileURLToPath("file://host/x", { windows: false }), /host/, ); }); it("decodes a UNC path with an ASCII host in the windows branch", () => { assert.strictEqual( fileURLToPath("file://server/share/file.js", { windows: true }), "\\\\server\\share\\file.js", ); }); // Documented deviation: Node runs UNC hosts through domainToUnicode // (punycode); this helper keeps the host as-is. Identical for ASCII hosts, // differing only for rare internationalized UNC hosts. // cspell:ignore aagokeh it("keeps a punycode UNC host as-is (deviation from Node)", () => { assert.strictEqual( fileURLToPath("file://xn--h1aagokeh/a", { windows: true }), "\\\\xn--h1aagokeh\\a", ); }); }); webpack-enhanced-resolve-7dfc9bc/test/fixtures/000077500000000000000000000000001523262174200217655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/a.js000066400000000000000000000000701523262174200225400ustar00rootroot00000000000000module.exports = function a() { return "This is a"; }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/abc.txt000066400000000000000000000000031523262174200232440ustar00rootroot00000000000000abcwebpack-enhanced-resolve-7dfc9bc/test/fixtures/alias-field-extras/000077500000000000000000000000001523262174200254435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/alias-field-extras/node_modules/000077500000000000000000000000001523262174200301205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/alias-field-extras/node_modules/pkg/000077500000000000000000000000001523262174200307015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/alias-field-extras/node_modules/pkg/index.js000066400000000000000000000000301523262174200323370ustar00rootroot00000000000000module.exports = "pkg"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/alias-field-extras/node_modules/pkg/package.json000066400000000000000000000000501523262174200331620ustar00rootroot00000000000000{ "name": "pkg", "main": "index.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/alias-field-extras/package.json000066400000000000000000000002311523262174200277250ustar00rootroot00000000000000{ "name": "alias-field-extras", "browser": { "./self-alias": "./self-alias", "self-mod": "self-mod", "./points-nowhere": "./does-not-exist" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/alias-field-extras/self-alias.js000066400000000000000000000000371523262174200300210ustar00rootroot00000000000000module.exports = "self-alias"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/b.js000066400000000000000000000000701523262174200225410ustar00rootroot00000000000000module.exports = function b() { return "This is b"; }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/bad-description-file/000077500000000000000000000000001523262174200257515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/bad-description-file/index.js000066400000000000000000000000351523262174200274140ustar00rootroot00000000000000module.exports = "bad-desc"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/bad-description-file/package.json000066400000000000000000000000311523262174200302310ustar00rootroot00000000000000{ this is not valid json webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/000077500000000000000000000000001523262174200247335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/browser/000077500000000000000000000000001523262174200264165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/browser/module-a.js000066400000000000000000000000001523262174200304450ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/lib/000077500000000000000000000000001523262174200255015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/lib/browser.js000066400000000000000000000000001523262174200275100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/lib/ignore.js000066400000000000000000000000001523262174200273100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/lib/main.js000066400000000000000000000000001523262174200267510ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/lib/replaced.js000066400000000000000000000000001523262174200276040ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/lib/toString.js000066400000000000000000000000001523262174200276360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/node_modules/000077500000000000000000000000001523262174200274105ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/node_modules/module-a.js000066400000000000000000000000001523262174200314370ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/node_modules/module-b.js000066400000000000000000000000001523262174200314400ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/node_modules/module-c.js000066400000000000000000000000001523262174200314410ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/browser-module/package.json000066400000000000000000000006531523262174200272250ustar00rootroot00000000000000{ "browser": { "./lib/ignore.js": false, "./lib/replaced.js": "./lib/browser", "module-a": "./browser/module-a.js", "module-b": "module-c", "./toString": "./lib/toString.js", ".": false }, "innerBrowser1": { "field": { "browser": { "./lib/main1.js": "./lib/main.js" } } }, "innerBrowser2": { "browser": { "./lib/main2.js": "./lib/replaced.js" } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/c.js000066400000000000000000000001111523262174200225360ustar00rootroot00000000000000module.exports = function b() { require("./a"); return "This is c"; }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/complex.js000066400000000000000000000006161523262174200237750ustar00rootroot00000000000000var complex1 = require("./lib/complex1"); require.ensure(["./lib/complex1", "complexm/step2"], function(require) { require("./lib/complex1"); var a = function() {}; require.ensure(["complexm/step1"], function(require) { require("./lib/complex1"); var s1 = require("complexm/step1"); var s2 = require("complexm/step2"); console.log(s1); console.log(s2); }); }); console.log(complex1); webpack-enhanced-resolve-7dfc9bc/test/fixtures/decorated-fs/000077500000000000000000000000001523262174200243255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/decorated-fs/exists.js000066400000000000000000000000001523262174200261700ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/dirOrFile.js000066400000000000000000000000311523262174200241740ustar00rootroot00000000000000module.exports = "file"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/dirOrFile/000077500000000000000000000000001523262174200236445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/dirOrFile/index.js000066400000000000000000000000301523262174200253020ustar00rootroot00000000000000module.exports = "dir"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/directory-default/000077500000000000000000000000001523262174200254135ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/directory-default/directory-default.js000066400000000000000000000000001523262174200313650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/empty-description-file/000077500000000000000000000000001523262174200263615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/empty-description-file/index.js000066400000000000000000000000371523262174200300260ustar00rootroot00000000000000module.exports = "empty-desc"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/empty-description-file/package.json000066400000000000000000000000001523262174200306350ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/000077500000000000000000000000001523262174200304135ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/000077500000000000000000000000001523262174200330705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/@org/000077500000000000000000000000001523262174200337575ustar00rootroot00000000000000pkg/000077500000000000000000000000001523262174200344615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/@orgdist/000077500000000000000000000000001523262174200354245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkgstring.js000066400000000000000000000000311523262174200372620ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/distexport default "string"; string.test.d.ts000066400000000000000000000000131523262174200404740ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg/distexport {}; package.json000066400000000000000000000002021523262174200367410ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/@org/pkg{ "name": "@org/pkg", "exports": { "./*.js": { "types": "./dist/*.d.ts", "default": "./dist/*.js" } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/000077500000000000000000000000001523262174200336515ustar00rootroot00000000000000dist/000077500000000000000000000000001523262174200345355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/pkgstring.js000066400000000000000000000000311523262174200363730ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/distexport default "string"; string.test.d.ts000066400000000000000000000000131523262174200376050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/pkg/distexport {}; package.json000066400000000000000000000002111523262174200360520ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-and-extension-alias/node_modules/pkg{ "name": "@raviqqe/hidash", "exports": { "./*.js": { "types": "./dist/*.d.ts", "default": "./dist/*.js" } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-error/000077500000000000000000000000001523262174200257015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-error/node_modules/000077500000000000000000000000001523262174200303565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-error/node_modules/exports-field/000077500000000000000000000000001523262174200331435ustar00rootroot00000000000000package.json000066400000000000000000000001611523262174200353500ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-error/node_modules/exports-field{ "name": "exports-field", "version": "1.0.0", "exports": { ".": "./a/../b/../../pack1/index.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-error/node_modules/pack1/000077500000000000000000000000001523262174200313555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-error/node_modules/pack1/index.js000066400000000000000000000000001523262174200330100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-extension-alias-opt-in/000077500000000000000000000000001523262174200310575ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-extension-alias-opt-in/node_modules/000077500000000000000000000000001523262174200335345ustar00rootroot00000000000000pkg/000077500000000000000000000000001523262174200342365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-extension-alias-opt-in/node_modulesdist/000077500000000000000000000000001523262174200352015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-extension-alias-opt-in/node_modules/pkgstring.js000066400000000000000000000000171523262174200370430ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-extension-alias-opt-in/node_modules/pkg/dist// js compiled string.ts000066400000000000000000000000151523262174200370530ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-extension-alias-opt-in/node_modules/pkg/dist// ts source package.json000066400000000000000000000000771523262174200365300ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-extension-alias-opt-in/node_modules/pkg{ "name": "pkg", "exports": { "./*.js": "./dist/*.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-invalid-package-target/000077500000000000000000000000001523262174200310535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-invalid-package-target/a.js000066400000000000000000000000241523262174200316250ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-invalid-package-target/package.json000066400000000000000000000032021523262174200333360ustar00rootroot00000000000000{ "name": "@exports-field/bad-specifier", "version": "1.0.0", "exports": { ".": [ "", "./a/../b/../../pack1/index.js", "././-bad-specifier-", "-bad-specifier-", "file.js", "./a.js?foo=../" ], "./foo/*": [ "", "./a/../b/../../pack1/index.js", "././-bad-specifier-", "-bad-specifier-", "file.js", "./a.js?foo=../#../" ], "./bar": "-bad-specifier-", "./baz": ["-bad-specifier-"], "./baz-multi": ["-bad-specifier-", "foo"], "./pattern/*.js": { "default": ["-bad-specifier-", "./*.js"] }, "./slash": ["/bar", "./a.js"], "./no-slash": [".bar", "./a.js"], "./utils/": { "browser": "/a/", "default": "/b/" }, "./utils1/": "/a/", "./utils2/": { "default": "../this/" }, "./utils3/*": { "default": "../this/*" }, "./utils4/*": "../src/*", "./utils5/": "../src/", "./*": ".", "./valid/*.js": { "default": ["-bad-specifier-", "./*.js"] }, "./non-existent.js": [ "-bad-specifier-", "./non-existent.js", "./a.js" ], "./bad-specifier.js": [ "-bad-specifier-", "../../a.js", "./a.js" ], "./bad-specifier1.js": [ "-bad-specifier-", "foo", "./a.js" ], "./dep/multi": ["../../test", "./a.js"], "./dep/multi1": ["../../test", "../../test/foo"], "./dep/multi2": ["../../test"], "./dep/multi3": ["./a/../b/../../pack1/index.js", "./a.js"], "./dep/multi4": ["./a/../b/../../pack1/index.js", "./c/../b/../../pack1/index.js"], "./dep/multi5": ["./a/../b/../../pack1/index.js"] } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/000077500000000000000000000000001523262174200275155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/node_modules/000077500000000000000000000000001523262174200321725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/node_modules/pkg/000077500000000000000000000000001523262174200327535ustar00rootroot00000000000000package.json000066400000000000000000000001451523262174200351620ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/node_modules/pkg{ "name": "pkg", "version": "2.0.0", "exports": { "./src/index.js": "./src/index.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/node_modules/pkg/src/000077500000000000000000000000001523262174200335425ustar00rootroot00000000000000index.js000066400000000000000000000000331523262174200351240ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/node_modules/pkg/src// pkg v2.0.0 - root level webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/workspace/000077500000000000000000000000001523262174200315135ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/workspace/node_modules/000077500000000000000000000000001523262174200341705ustar00rootroot00000000000000pkg/000077500000000000000000000000001523262174200346725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/workspace/node_modulespackage.json000066400000000000000000000001461523262174200371610ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field-nested-version/workspace/node_modules/pkg{ "name": "pkg", "version": "1.0.0", "exports": { "./src/index.js": "./dist/index.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/000077500000000000000000000000001523262174200245525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/a.js000066400000000000000000000000241523262174200253240ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/000077500000000000000000000000001523262174200272275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/000077500000000000000000000000001523262174200320145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/lib/000077500000000000000000000000001523262174200325625ustar00rootroot00000000000000browser.js000066400000000000000000000000241523262174200345200ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/libmodule.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/lib/index.js000066400000000000000000000000001523262174200342150ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/lib/lib2/000077500000000000000000000000001523262174200334125ustar00rootroot00000000000000main.js000066400000000000000000000000241523262174200346110ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/lib/lib2module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/lib/main.js000066400000000000000000000000241523262174200340400ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/main.js000066400000000000000000000000241523262174200332720ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/package.json000066400000000000000000000006331523262174200343040ustar00rootroot00000000000000{ "name": "exports-field", "version": "1.0.0", "main": "./main.js", "browser": { "./lib/main.js": "./lib/browser.js", "./dist/main.js": "./lib/browser.js" }, "exports": { ".": "./x.js", "./dist/": { "custom": ["./lib/lib2/", "./lib/"], "webpack": ["./lib/", "./lib/lib2/"], "node": "./lib/", "default": "./lib/" }, "./dist/a.js": "./../../a.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/exports-field/x.js000066400000000000000000000000241523262174200326150ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/invalid-exports-field/000077500000000000000000000000001523262174200334405ustar00rootroot00000000000000index.js000066400000000000000000000000001523262174200350140ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/invalid-exports-fieldpackage.json000066400000000000000000000003621523262174200356500ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/invalid-exports-field{ "name": "exports-field", "version": "1.0.0", "main": "./main.js", "browser": { "./lib/main.js": "./lib/browser.js", "./dist/main.js": "./lib/browser.js" }, "exports": { ".": "./index.js", "umd": "./umd.js" } } umd.js000066400000000000000000000000001523262174200344720ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/node_modules/invalid-exports-fieldwebpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field/package.json000066400000000000000000000001211523262174200270320ustar00rootroot00000000000000{ "name": "@exports-field/core", "version": "1.0.0", "exports": "./a.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/000077500000000000000000000000001523262174200246345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/000077500000000000000000000000001523262174200273115ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/000077500000000000000000000000001523262174200320765ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/index.js000066400000000000000000000000241523262174200335370ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/lib/000077500000000000000000000000001523262174200326445ustar00rootroot00000000000000browser.js000066400000000000000000000000241523262174200346020ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/libmodule.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2/000077500000000000000000000000001523262174200334745ustar00rootroot00000000000000main.js000066400000000000000000000000241523262174200346730ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/lib/lib2module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/lib/main.js000066400000000000000000000000241523262174200341220ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field/main.js000066400000000000000000000000241523262174200333540ustar00rootroot00000000000000module.exports = 1; package.json000066400000000000000000000005211523262174200343030ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field2/node_modules/exports-field{ "name": "exports-field", "version": "1.0.0", "main": "./main.js", "browser": { "./lib/main.js": "./lib/browser.js", "./dist/main.js": "./lib/browser.js" }, "exports": { ".": "./index.js", "./dist/": { "webpack": ["./lib/", "./lib/lib2/"], "node": "./lib/", "default": "./lib/" } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field3/000077500000000000000000000000001523262174200246355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field3/node_modules/000077500000000000000000000000001523262174200273125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field3/node_modules/exports-field/000077500000000000000000000000001523262174200320775ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field3/node_modules/exports-field/index000066400000000000000000000000001523262174200331170ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field3/node_modules/exports-field/main.js000066400000000000000000000000241523262174200333550ustar00rootroot00000000000000module.exports = 1; package.json000066400000000000000000000001451523262174200343060ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/exports-field3/node_modules/exports-field{ "name": "exports-field", "exportsField": { "exports": "./main.js" }, "ex": "./index" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/000077500000000000000000000000001523262174200250705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir/000077500000000000000000000000001523262174200256465ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir/index.js000066400000000000000000000000001523262174200273010ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir/index.ts000066400000000000000000000000001523262174200273130ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir2/000077500000000000000000000000001523262174200257305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir2/index.js000066400000000000000000000000001523262174200273630ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir2/index.mts000066400000000000000000000000001523262174200275520ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir3.js/000077500000000000000000000000001523262174200263445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/dir3.js/index.js000066400000000000000000000000451523262174200300100ustar00rootroot00000000000000module.exports = "dir3.js/index.js"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/index.js000066400000000000000000000000001523262174200265230ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/index.mjs000066400000000000000000000000001523262174200267000ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/index.mts.js000066400000000000000000000000001523262174200273250ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/index.ts000066400000000000000000000000001523262174200265350ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/node_modules/000077500000000000000000000000001523262174200275455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/node_modules/pkg.js/000077500000000000000000000000001523262174200307415ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/node_modules/pkg.js/dist/000077500000000000000000000000001523262174200317045ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/node_modules/pkg.js/dist/main.js000066400000000000000000000000331523262174200331620ustar00rootroot00000000000000module.exports = "pkg.js"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/extension-alias/node_modules/pkg.js/package.json000066400000000000000000000001071523262174200332250ustar00rootroot00000000000000{ "name": "pkg.js", "version": "1.0.0", "main": "dist/main.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/000077500000000000000000000000001523262174200241645ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/dir/000077500000000000000000000000001523262174200247425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/dir/index.js000066400000000000000000000000001523262174200263750ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/dir/index.ts000066400000000000000000000000001523262174200264070ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/foo.js000066400000000000000000000000001523262174200252730ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/foo.ts000066400000000000000000000000001523262174200253050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/index.js000066400000000000000000000000001523262174200256170ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/index.ts000066400000000000000000000000001523262174200256310ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/node_modules/000077500000000000000000000000001523262174200266415ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/node_modules/module.js000066400000000000000000000000001523262174200304520ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/node_modules/module/000077500000000000000000000000001523262174200301265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/node_modules/module/index.ts000066400000000000000000000000001523262174200315730ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/extensions/package.json000066400000000000000000000000331523262174200264460ustar00rootroot00000000000000{ "main": "./index.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/file.load1000066400000000000000000000000001523262174200236140ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/file.load2000066400000000000000000000000001523262174200236150ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/foo/000077500000000000000000000000001523262174200225505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/foo/index.js000066400000000000000000000000001523262174200242030ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/foo/package.json000066400000000000000000000000521523262174200250330ustar00rootroot00000000000000{ "name": "foo", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/000077500000000000000000000000001523262174200267535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/000077500000000000000000000000001523262174200314305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/000077500000000000000000000000001523262174200316645ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/package.json000066400000000000000000000010331523262174200341470ustar00rootroot00000000000000{ "name": "m", "exports": { "./features-no-ext/*": "./src/features/*", "./features/*.js": "./src/features/*.js", "./features/internal/*": null, "./middle/nested/f.js": "./src/middle/nested/f.js", "./middle-1/nested/*.js": "./src/middle-1/nested/*.js", "./middle-2/*/f.js": "./src/middle-2/*/f.js", "./middle-3/*": "./src/middle-3/*/*.js", "./middle-4/*/nested": "./src/middle-4/*/*.js", "./middle-5/*/$": "./src/middle-5/*/$.js" }, "imports": { "#internal/*.js": "./src/internal/*.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/000077500000000000000000000000001523262174200324535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/000077500000000000000000000000001523262174200342715ustar00rootroot00000000000000f.js000066400000000000000000000000001523262174200347630ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/featuresinternal/000077500000000000000000000000001523262174200360265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/featuresfile.js000066400000000000000000000000001523262174200372710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/internaly/000077500000000000000000000000001523262174200344625ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/featuresy.js000066400000000000000000000000001523262174200352560ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/features/ywebpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/internal/000077500000000000000000000000001523262174200342675ustar00rootroot00000000000000i.js000066400000000000000000000000001523262174200347640ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/internalwebpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/000077500000000000000000000000001523262174200340475ustar00rootroot00000000000000f.js000066400000000000000000000000001523262174200345410ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1nested/000077500000000000000000000000001523262174200352525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1f.js000066400000000000000000000000001523262174200360230ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-1/nestedwebpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/000077500000000000000000000000001523262174200340505ustar00rootroot00000000000000nested/000077500000000000000000000000001523262174200352535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2f.js000066400000000000000000000000461523262174200360360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-2/nestedmodule.exports = { nested: "nested" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/000077500000000000000000000000001523262174200340515ustar00rootroot00000000000000nested/000077500000000000000000000000001523262174200352545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3f/000077500000000000000000000000001523262174200355015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nestednested/000077500000000000000000000000001523262174200367635ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/ff.js000066400000000000000000000000001523262174200375340ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-3/nested/f/nestedwebpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/000077500000000000000000000000001523262174200340525ustar00rootroot00000000000000f/000077500000000000000000000000001523262174200342205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4f.js000066400000000000000000000000001523262174200347710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-4/fwebpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/000077500000000000000000000000001523262174200340535ustar00rootroot00000000000000f$/000077500000000000000000000000001523262174200342655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5$.js000066400000000000000000000000001523262174200347340ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/f$f/000077500000000000000000000000001523262174200342215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5$.js000066400000000000000000000000001523262174200346700ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle-5/fwebpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/000077500000000000000000000000001523262174200337115ustar00rootroot00000000000000f.js000066400000000000000000000000001523262174200344030ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middlenested/000077500000000000000000000000001523262174200351145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middlef.js000066400000000000000000000000001523262174200356650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-exports-wildcard/node_modules/m/src/middle/nestedwebpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-chained/000077500000000000000000000000001523262174200261345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-chained/package.json000066400000000000000000000001651523262174200304240ustar00rootroot00000000000000{ "name": "imports-field-chained", "version": "1.0.0", "imports": { "#a": "#b", "#b": "./the.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-chained/the.js000066400000000000000000000000001523262174200272400ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-different/000077500000000000000000000000001523262174200265075ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-different/a.js000066400000000000000000000000241523262174200272610ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-different/package.json000066400000000000000000000021311523262174200307720ustar00rootroot00000000000000{ "name": "@exports-field/bad-specifier", "version": "1.0.0", "imports": { "/utils/": "./a/", "/utils1/": { "browser": "./a/", "default": "./b/" }, "a": "a.js", "#": "a.js", "#/dep": "a.js", "#dep/": "a.js", "#dep": [ "./a/../b/../../pack1/index.js", "././-bad-specifier-", "./a.js?foo=../" ], "#dep/foo/*": [ "./a/../b/../../pack1/index.js", "././-bad-specifier-", "./a.js?foo=../#../" ], "#dep/bar": "-bad-specifier-", "#dep/baz": ["-bad-specifier-"], "#dep/baz-multi": ["-bad-specifier-", "not-found"], "#dep/pattern/*.js": { "default": ["-bad-specifier-", "./*.js"] }, "#dep/array": ["./a.js", "-bad-specifier-"], "#dep/array2": ["-bad-specifier-", "./a.js"], "#dep/array3": ["./a.js"], "#dep/empty": "", "#dep/with-bad": ["../foo", "./a.js"], "#dep/with-bad2": ["./a.js", "../foo"], "#timezones/": "./data/timezones", "#dep/multi": ["../../test", "./a.js"], "#dep/multi1": ["../../test", "../../test/foo"], "#dep/multi2": ["../../test"] } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-error-trigger/000077500000000000000000000000001523262174200273335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-error-trigger/package.json000066400000000000000000000001331523262174200316160ustar00rootroot00000000000000{ "name": "imports-field-error-trigger", "imports": { "#trigger": "./resolved.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-error-trigger/resolved.js000066400000000000000000000000451523262174200315130ustar00rootroot00000000000000module.exports = "imports-resolved"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-extension-alias/000077500000000000000000000000001523262174200276445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-extension-alias/bar.js000066400000000000000000000000121523262174200307370ustar00rootroot00000000000000// bar js webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-extension-alias/foo.js000066400000000000000000000000061523262174200307610ustar00rootroot00000000000000// js webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-extension-alias/foo.ts000066400000000000000000000000061523262174200307730ustar00rootroot00000000000000// ts webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-extension-alias/only.mjs000066400000000000000000000000141523262174200313330ustar00rootroot00000000000000// only mjs webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field-extension-alias/package.json000066400000000000000000000002301523262174200321250ustar00rootroot00000000000000{ "name": "imports-field-extension-alias", "version": "1.0.0", "imports": { "#foo": "./foo.js", "#bar": "./bar.js", "#only": "./only.mjs" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/000077500000000000000000000000001523262174200245435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/a.js000066400000000000000000000000241523262174200253150ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/b.js000066400000000000000000000000001523262174200253100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/dir/000077500000000000000000000000001523262174200253215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/dir/b.js000066400000000000000000000000001523262174200260660ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/000077500000000000000000000000001523262174200272205ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/000077500000000000000000000000001523262174200274405ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/lib/000077500000000000000000000000001523262174200302065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/lib/browser.js000066400000000000000000000000241523262174200322230ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/lib/index.js000066400000000000000000000000001523262174200316410ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/lib/lib2/000077500000000000000000000000001523262174200310365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/lib/lib2/main.js000066400000000000000000000000241523262174200323140ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/lib/main.js000066400000000000000000000000241523262174200314640ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/main.js000066400000000000000000000000241523262174200307160ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/package.json000066400000000000000000000005441523262174200317310ustar00rootroot00000000000000{ "name": "a", "version": "1.0.0", "main": "./main.js", "browser": { "./lib/main.js": "./lib/browser.js", "./dist/main.js": "./lib/browser.js" }, "exports": { ".": "./x.js", "./dist/": { "webpack": ["./lib/", "./lib/lib2/"], "node": "./lib/", "default": "./lib/" }, "./dist/a.js": "./../../a.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/a/x.js000066400000000000000000000000241523262174200302410ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/c/000077500000000000000000000000001523262174200274425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/node_modules/c/index.js000066400000000000000000000000001523262174200310750ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-field/package.json000066400000000000000000000004041523262174200270270ustar00rootroot00000000000000{ "name": "imports-field", "version": "1.0.0", "exports": "./a.js", "imports": { "#imports-field": "./b.js", "#b": "../b.js", "#ccc/": "c/", "#c": "c", "#a/": "a/" }, "other": { "imports": { "#b": "./a.js" } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-slash-pattern/000077500000000000000000000000001523262174200262455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-slash-pattern/package.json000066400000000000000000000001121523262174200305250ustar00rootroot00000000000000{ "name": "imports-slash-pattern", "imports": { "#/*": "./src/*" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-slash-pattern/src/000077500000000000000000000000001523262174200270345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-slash-pattern/src/nested/000077500000000000000000000000001523262174200303165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-slash-pattern/src/nested/deep.js000066400000000000000000000000311523262174200315630ustar00rootroot00000000000000module.exports = "deep"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/imports-slash-pattern/src/utils.js000066400000000000000000000000321523262174200305250ustar00rootroot00000000000000module.exports = "utils"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/incorrect-package/000077500000000000000000000000001523262174200253465ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/incorrect-package/pack1/000077500000000000000000000000001523262174200263455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/incorrect-package/pack1/a.js000066400000000000000000000000001523262174200271110ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/incorrect-package/pack1/package.json000066400000000000000000000000261523262174200306310ustar00rootroot00000000000000{ "main": "./a.js", webpack-enhanced-resolve-7dfc9bc/test/fixtures/incorrect-package/pack2/000077500000000000000000000000001523262174200263465ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/incorrect-package/pack2/a.js000066400000000000000000000000001523262174200271120ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/incorrect-package/pack2/package.json000066400000000000000000000000001523262174200306220ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/000077500000000000000000000000001523262174200234275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/package.json000066400000000000000000000000261523262174200257130ustar00rootroot00000000000000{ "private": true } webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/src/000077500000000000000000000000001523262174200242165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/src/a/000077500000000000000000000000001523262174200244365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/src/a/config.js000066400000000000000000000000001523262174200262270ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/src/common/000077500000000000000000000000001523262174200255065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/src/common/config/000077500000000000000000000000001523262174200267535ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/issue-238/src/common/config/myObjectFile.js000066400000000000000000000000001523262174200316530ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/lib/000077500000000000000000000000001523262174200225335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/lib/complex1.js000066400000000000000000000000411523262174200246140ustar00rootroot00000000000000module.exports = "lib complex1"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/main-field-self/000077500000000000000000000000001523262174200247215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/main-field-self/index.js000066400000000000000000000000001523262174200263540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/main-field-self/package.json000066400000000000000000000000231523262174200272020ustar00rootroot00000000000000{ "main": "./" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/main-field-self2/000077500000000000000000000000001523262174200250035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/main-field-self2/index.js000066400000000000000000000000001523262174200264360ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/main-field-self2/package.json000066400000000000000000000000221523262174200272630ustar00rootroot00000000000000{ "main": "." } webpack-enhanced-resolve-7dfc9bc/test/fixtures/main1.js000066400000000000000000000002241523262174200233260ustar00rootroot00000000000000var a = require("./a"); if (x) { for (var i = 0; i < 100; i++) { while (true) require("./b"); do { i++; } while (require("m1/a")()); } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/main2.js000066400000000000000000000003051523262174200233270ustar00rootroot00000000000000var a = require("./a"); with (x) { switch (a) { case 1: require("./b"); default: require.ensure(["m1/a"], function() { var a = require("m1/a"), b = require("m1/b"); }); } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/main3.js000066400000000000000000000001271523262174200233320ustar00rootroot00000000000000var a = require("./a"); require.ensure([], function(require) { require("./c.js"); }); webpack-enhanced-resolve-7dfc9bc/test/fixtures/multiple_modules/000077500000000000000000000000001523262174200253505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/multiple_modules/node_modules/000077500000000000000000000000001523262174200300255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/multiple_modules/node_modules/m1/000077500000000000000000000000001523262174200303425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/multiple_modules/node_modules/m1/a.js000066400000000000000000000001021523262174200311110ustar00rootroot00000000000000module.exports = function a() { return "This is nested m1/a"; }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/no#fragment/000077500000000000000000000000001523262174200241705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/no#fragment/#/000077500000000000000000000000001523262174200243125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/no#fragment/#/#.js000066400000000000000000000000001523262174200247600ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/no.js000066400000000000000000000000001523262174200227250ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/000077500000000000000000000000001523262174200244425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/complexm/000077500000000000000000000000001523262174200262665ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/complexm/node_modules/000077500000000000000000000000001523262174200307435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/complexm/node_modules/m1/000077500000000000000000000000001523262174200312605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/complexm/node_modules/m1/a.js000066400000000000000000000000451523262174200320350ustar00rootroot00000000000000module.exports = "the correct a.js"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/complexm/node_modules/m1/index.js000066400000000000000000000000561523262174200327260ustar00rootroot00000000000000module.exports = " :) " + require("m2/b.js"); webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/complexm/step1.js000066400000000000000000000000621523262174200276560ustar00rootroot00000000000000module.exports = require("m1/a") + require("m1"); webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/complexm/step2.js000066400000000000000000000000321523262174200276540ustar00rootroot00000000000000module.exports = "Step2"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/invalidPackageJson/000077500000000000000000000000001523262174200301765ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/invalidPackageJson/package.json000066400000000000000000000000001523262174200324520ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/m1/000077500000000000000000000000001523262174200247575ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/m1/a.js000066400000000000000000000000731523262174200255350ustar00rootroot00000000000000module.exports = function a() { return "This is m1/a"; }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/m1/b.js000066400000000000000000000000731523262174200255360ustar00rootroot00000000000000module.exports = function a() { return "This is m1/b"; }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/m2/000077500000000000000000000000001523262174200247605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/m2/b.js000066400000000000000000000000411523262174200255320ustar00rootroot00000000000000module.exports = "This is m2/b"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/recursive-module/000077500000000000000000000000001523262174200277345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/recursive-module/file.js000066400000000000000000000000001523262174200311770ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/node_modules/recursive-module/index.js000066400000000000000000000000001523262174200313670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp-a/000077500000000000000000000000001523262174200230005ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp-a/m2/000077500000000000000000000000001523262174200233165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp-a/m2/a.js000066400000000000000000000001021523262174200240650ustar00rootroot00000000000000module.exports = function a() { return "This is nested m1/a"; }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/000077500000000000000000000000001523262174200225625ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/000077500000000000000000000000001523262174200233435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/dir/000077500000000000000000000000001523262174200241215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/dir/index.js000066400000000000000000000000001523262174200255540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/index.js000066400000000000000000000000001523262174200247760ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/main.js000066400000000000000000000000001523262174200246130ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/package-alias/000077500000000000000000000000001523262174200260255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/package-alias/browser.js000066400000000000000000000000001523262174200300340ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/package-alias/index.js000066400000000000000000000000001523262174200274600ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/package.json000066400000000000000000000002101523262174200256220ustar00rootroot00000000000000{ "main": "main.js", "browser": { "./package-alias/index.js": "./package-alias/browser.js", "module": "pkg/dir/index" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/typescript/000077500000000000000000000000001523262174200255515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg/typescript/index.ts000066400000000000000000000000001523262174200272160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg3/000077500000000000000000000000001523262174200234265ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg3/a.js000066400000000000000000000000241523262174200242000ustar00rootroot00000000000000module.exports = 1; webpack-enhanced-resolve-7dfc9bc/test/fixtures/pnp/pkg3/package.json000066400000000000000000000001651523262174200257160ustar00rootroot00000000000000{ "name": "@exports-field/core", "version": "1.0.0", "exports": { ".": "./a.js", "./x": "./a.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/prefer-pnp/000077500000000000000000000000001523262174200240435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/prefer-pnp/alternative-modules/000077500000000000000000000000001523262174200300275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/prefer-pnp/alternative-modules/m1/000077500000000000000000000000001523262174200303445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/prefer-pnp/alternative-modules/m1/b.js000066400000000000000000000000001523262174200311110ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/000077500000000000000000000000001523262174200245155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/build/000077500000000000000000000000001523262174200256145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/build/node_modules/000077500000000000000000000000001523262174200302715ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/build/node_modules/exports-pck/000077500000000000000000000000001523262174200325505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/build/node_modules/exports-pck/lib/000077500000000000000000000000001523262174200333165ustar00rootroot00000000000000index.js000066400000000000000000000000321523262174200346770ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/build/node_modules/exports-pck/libmodule.exports = "build"; package.json000066400000000000000000000001121523262174200347510ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/build/node_modules/exports-pck{ "name": "exports-pck", "exports": { ".": "./lib/index.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/000077500000000000000000000000001523262174200271725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/exports-pck/000077500000000000000000000000001523262174200314515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/exports-pck/lib/000077500000000000000000000000001523262174200322175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/exports-pck/lib/index.js000066400000000000000000000000411523262174200336570ustar00rootroot00000000000000module.exports = "node_modules"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/exports-pck/package.json000066400000000000000000000001121523262174200337310ustar00rootroot00000000000000{ "name": "exports-pck", "exports": { ".": "./lib/index.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck1/000077500000000000000000000000001523262174200300305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck1/index.css000066400000000000000000000000001523262174200316370ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck1/index.js000066400000000000000000000000001523262174200314630ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck1/package.json000066400000000000000000000000311523262174200323100ustar00rootroot00000000000000{ "main": "index.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck2/000077500000000000000000000000001523262174200300315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck2/index.css000066400000000000000000000000001523262174200316400ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck2/module.js000066400000000000000000000000001523262174200316420ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/restrictions/node_modules/pck2/package.json000066400000000000000000000001171523262174200323160ustar00rootroot00000000000000{ "main": "../../../c.js", "module": "module.js", "style": "index.css" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/000077500000000000000000000000001523262174200232425ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/000077500000000000000000000000001523262174200257175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/000077500000000000000000000000001523262174200271305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack1/000077500000000000000000000000001523262174200301275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack1/main.js000066400000000000000000000000001523262174200313770ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack1/package.json000066400000000000000000000000651523262174200324160ustar00rootroot00000000000000{ "browser": { "./index.js": "./main.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack2/000077500000000000000000000000001523262174200301305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack2/lib/000077500000000000000000000000001523262174200306765ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack2/lib/index.js000066400000000000000000000000001523262174200323310ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack2/main.js000066400000000000000000000000001523262174200314000ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/scoped/node_modules/@scope/pack2/package.json000066400000000000000000000000321523262174200324110ustar00rootroot00000000000000{ "main": "./main.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/self-reference-pkg/000077500000000000000000000000001523262174200254315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/self-reference-pkg/caller.js000066400000000000000000000000561523262174200272320ustar00rootroot00000000000000require("self-pkg"); require("self-pkg/sub"); webpack-enhanced-resolve-7dfc9bc/test/fixtures/self-reference-pkg/index.js000066400000000000000000000000371523262174200270760ustar00rootroot00000000000000module.exports = "self-index"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/self-reference-pkg/package.json000066400000000000000000000001251523262174200277150ustar00rootroot00000000000000{ "name": "self-pkg", "exports": { ".": "./index.js", "./sub": "./sub.js" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/self-reference-pkg/sub.js000066400000000000000000000000351523262174200265560ustar00rootroot00000000000000module.exports = "self-sub"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/shortcutdir.js/000077500000000000000000000000001523262174200247525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/shortcutdir.js/a.js000066400000000000000000000000001523262174200255160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/000077500000000000000000000000001523262174200247165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/000077500000000000000000000000001523262174200256305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/000077500000000000000000000000001523262174200264175ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/components/000077500000000000000000000000001523262174200306045ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/components/button.ts000066400000000000000000000000571523262174200324710ustar00rootroot00000000000000export function button() { return "button"; }webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/components/new-file.ts000066400000000000000000000000421523262174200326560ustar00rootroot00000000000000export const newFile = "new-file";webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/index.ts000066400000000000000000000010751523262174200301010ustar00rootroot00000000000000import * as foo from "foo"; import * as file1 from "foo/file1"; import * as bar from "bar/file1"; import * as myStar from "star-bar"; import * as longest from "longest/bar"; import * as packagedBrowser from "browser-field-package"; import * as packagedMain from "main-field-package"; import * as packagedIndex from "no-main-field-package"; import * as newFile from "utils/old-file"; console.log( "HELLO WORLD!", foo.message, bar.message, file1, longest, myStar.message, packagedBrowser.message, packagedMain.message, packagedIndex.message, newFile ); webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/000077500000000000000000000000001523262174200276655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/bar/000077500000000000000000000000001523262174200304315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/bar/file1.ts000066400000000000000000000000361523262174200320000ustar00rootroot00000000000000export const message = "bar"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/foo/000077500000000000000000000000001523262174200304505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/foo/index.ts000066400000000000000000000000411523262174200321220ustar00rootroot00000000000000export const message = "HELLO!"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/longest/000077500000000000000000000000001523262174200313405ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/longest/one.ts000066400000000000000000000000221523262174200324630ustar00rootroot00000000000000export const a = 1webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/longest/three.ts000066400000000000000000000000221523262174200330110ustar00rootroot00000000000000export const a = 1webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/longest/two.ts000066400000000000000000000000221523262174200325130ustar00rootroot00000000000000export const a = 1webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/000077500000000000000000000000001523262174200306365ustar00rootroot00000000000000browser-field-package/000077500000000000000000000000001523262174200347145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/starbrowser.ts000066400000000000000000000000421523262174200367430ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-packageexport const message = "browser"; node.ts000066400000000000000000000000371523262174200362110ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-packageexport const message = "node"; package.json000066400000000000000000000001161523262174200372000ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/browser-field-package{ "name": "browser-field", "main": "node.ts", "browser": "browser.ts" } main-field-package/000077500000000000000000000000001523262174200341555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/starnode.ts000066400000000000000000000000371523262174200354520ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-packageexport const message = "node"; package.json000066400000000000000000000000601523262174200364370ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/main-field-package{ "name": "main-field", "main": "node.ts" } no-main-field-package/000077500000000000000000000000001523262174200345675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/starindex.ts000066400000000000000000000000401523262174200362400ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-packageexport const message = "index"; package.json000066400000000000000000000000361523262174200370540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/no-main-field-package{ "name": "no-main-field" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/star-bar/000077500000000000000000000000001523262174200323515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/mapped/star/star-bar/index.ts000066400000000000000000000000461523262174200340300ustar00rootroot00000000000000export const message = "Hello Star!"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/refs/000077500000000000000000000000001523262174200273565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/refs/index.ts000066400000000000000000000000461523262174200310350ustar00rootroot00000000000000export const message = "HELLO WORLD!";webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/utils/000077500000000000000000000000001523262174200275575ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/src/utils/date.ts000066400000000000000000000000531523262174200310420ustar00rootroot00000000000000export function date() { return "date"; }webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/base/tsconfig.json000066400000000000000000000013601523262174200303370ustar00rootroot00000000000000{ "compilerOptions": { "module": "commonjs", "target": "es5", "outDir": "./js_out", "baseUrl": ".", "paths": { "@components/*": ["${configDir}/src/utils/*", "${configDir}/src/components/*"], "@utils/*": ["./src/utils/*"], "foo": ["${configDir}/src/mapped/foo"], "foo/*": ["${configDir}/src/mapped/bar/*"], "bar/*": ["./src/mapped/bar/*"], "refs/*": ["${configDir}/src/refs/*"], "*/old-file": ["${configDir}/src/components/new-file"], "longest/*": ["${configDir}/src/mapped/longest/four.ts", "${configDir}/src/mapped/longest/two.ts"], "longest/bar": ["${configDir}/src/mapped/longest/three.ts"], "*": ["${configDir}/src/mapped/star/*"] }, "composite": true } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/000077500000000000000000000000001523262174200304255ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modules/000077500000000000000000000000001523262174200331025ustar00rootroot00000000000000@scope/000077500000000000000000000000001523262174200342345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modulespkg/000077500000000000000000000000001523262174200350155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modules/@scopedist/000077500000000000000000000000001523262174200357605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modules/@scope/pkgindex.js000066400000000000000000000000471523262174200374260ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modules/@scope/pkg/distmodule.exports = require("./sibling"); sibling.js000066400000000000000000000000341523262174200377420ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modules/@scope/pkg/distmodule.exports = "sibling"; package.json000066400000000000000000000001141523262174200372770ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modules/@scope/pkg{ "name": "@scope/pkg", "version": "1.0.0", "main": "dist/index.js" } tsconfig.json000066400000000000000000000001701523262174200375220ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/node_modules/@scope/pkg{ "extends": "../../tsconfig-base.json", "compilerOptions": { "outDir": "dist" }, "include": ["src/**/*"] } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/src/000077500000000000000000000000001523262174200312145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/src/hello.js000066400000000000000000000000361523262174200326540ustar00rootroot00000000000000module.exports = "app-hello"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/broken-pkg-extends/tsconfig.json000066400000000000000000000001441523262174200331330ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@app/*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/000077500000000000000000000000001523262174200273005ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/src/000077500000000000000000000000001523262174200300675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/src/components/000077500000000000000000000000001523262174200322545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/src/components/button.ts000066400000000000000000000000571523262174200341410ustar00rootroot00000000000000export function button() { return "button"; }webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/src/index.ts000066400000000000000000000002101523262174200315370ustar00rootroot00000000000000import * as button from "@components/button"; import * as date from "@utils/date"; console.log( "HELLO WORLD!", button, date, ); webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/src/utils/000077500000000000000000000000001523262174200312275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/src/utils/date.ts000066400000000000000000000000531523262174200325120ustar00rootroot00000000000000export function date() { return "date"; }webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-base/tsconfig.json000066400000000000000000000001401523262174200320020ustar00rootroot00000000000000{ "extends": "${configDir}/../base/tsconfig", "compilerOptions": { "baseUrl": "." } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/000077500000000000000000000000001523262174200301725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/a/000077500000000000000000000000001523262174200304125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/a/src/000077500000000000000000000000001523262174200312015ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/a/src/lib/000077500000000000000000000000001523262174200317475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/a/src/lib/foo.ts000066400000000000000000000000331523262174200330760ustar00rootroot00000000000000export const foo = "foo"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/a/tsconfig.json000066400000000000000000000002231523262174200331160ustar00rootroot00000000000000{ "extends": "${configDir}/../b/tsconfig", "compilerOptions": { "baseUrl": ".", "paths": { "@lib/*": ["${configDir}/src/lib/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/b/000077500000000000000000000000001523262174200304135ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/b/src/000077500000000000000000000000001523262174200312025ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/b/src/util/000077500000000000000000000000001523262174200321575ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/b/src/util/bar.ts000066400000000000000000000000331523262174200332670ustar00rootroot00000000000000export const bar = "bar"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-circular/b/tsconfig.json000066400000000000000000000002251523262174200331210ustar00rootroot00000000000000{ "extends": "${configDir}/../a/tsconfig", "compilerOptions": { "baseUrl": ".", "paths": { "@util/*": ["${configDir}/src/util/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/000077500000000000000000000000001523262174200307365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/000077500000000000000000000000001523262174200325145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/app/000077500000000000000000000000001523262174200332745ustar00rootroot00000000000000tsconfig.json000066400000000000000000000000431523262174200357210ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/app{ "extends": "../lib/tsconfig" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/lib/000077500000000000000000000000001523262174200332625ustar00rootroot00000000000000tsconfig.json000066400000000000000000000000601523262174200357060ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/packages/lib{ "extends": "../../tsconfig-base/tsconfig" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/000077500000000000000000000000001523262174200334625ustar00rootroot00000000000000src/000077500000000000000000000000001523262174200341725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-baseutils/000077500000000000000000000000001523262174200353325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/srcformat.ts000066400000000000000000000000501523262174200371650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base/src/utilsexport const format = (s: string) => s; tsconfig.json000066400000000000000000000001451523262174200361120ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-deep-baseurl/tsconfig-base{ "compilerOptions": { "baseUrl": ".", "paths": { "@base/*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative-slash/000077500000000000000000000000001523262174200327605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative-slash/src/000077500000000000000000000000001523262174200335475ustar00rootroot00000000000000y.ts000066400000000000000000000000261523262174200343060ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative-slash/srcexport const y = "y"; tsconfig.json000066400000000000000000000001671523262174200354140ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative-slash{ "extends": "../../tsconfig-base.json", "compilerOptions": { "paths": { "@x/*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative/000077500000000000000000000000001523262174200316505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative/src/000077500000000000000000000000001523262174200324375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative/src/y.ts000066400000000000000000000000261523262174200332550ustar00rootroot00000000000000export const y = "y"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-missing-relative/tsconfig.json000066400000000000000000000001541523262174200343570ustar00rootroot00000000000000{ "extends": ".missing-base", "compilerOptions": { "paths": { "@x/*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/000077500000000000000000000000001523262174200311545ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/node_modules/000077500000000000000000000000001523262174200336315ustar00rootroot00000000000000@my-tsconfig/000077500000000000000000000000001523262174200361115ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/node_modulesbase/000077500000000000000000000000001523262174200370235ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/node_modules/@my-tsconfigpackage.json000066400000000000000000000001231523262174200413050ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/node_modules/@my-tsconfig/base{ "name": "@my-tsconfig/base", "version": "1.0.0", "main": "tsconfig.json" } src/000077500000000000000000000000001523262174200376125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/node_modules/@my-tsconfig/baseutil.ts000066400000000000000000000000341523262174200411340ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/node_modules/@my-tsconfig/base/srcexport const util = "util"; tsconfig.node.json000066400000000000000000000001441523262174200424550ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/node_modules/@my-tsconfig/base{ "compilerOptions": { "baseUrl": ".", "paths": { "@pkg/*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/packages/000077500000000000000000000000001523262174200327325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/packages/app/000077500000000000000000000000001523262174200335125ustar00rootroot00000000000000tsconfig.json000066400000000000000000000000631523262174200361410ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm-workspace/packages/app{ "extends": "@my-tsconfig/base/tsconfig.node" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/000077500000000000000000000000001523262174200271605ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/node_modules/000077500000000000000000000000001523262174200316355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/node_modules/react/000077500000000000000000000000001523262174200327335ustar00rootroot00000000000000package.json000066400000000000000000000001671523262174200351460ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/node_modules/react{ "name": "react", "version": "18.3.1", "main": "index.js", "scripts": { "build": "tsc" } }tsconfig.json000066400000000000000000000011331523262174200353610ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/node_modules/react{ "compilerOptions": { "module": "commonjs", "target": "es5", "outDir": "./js_out", "baseUrl": ".", "paths": { "@components/*": ["./src/utils/*", "./src/components/*"], "@utils/*": ["./src/utils/*"], "foo": ["./src/mapped/foo"], "bar/*": ["./src/mapped/bar/*"], "refs/*": ["./src/refs/*"], "*/old-file": ["./src/components/new-file"], "longest/*": ["./src/mapped/longest/four.ts", "./src/mapped/longest/two.ts"], "longest/bar": ["./src/mapped/longest/three.ts"], "*": ["./src/mapped/star/*"] }, "composite": true } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/src/000077500000000000000000000000001523262174200277475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/src/components/000077500000000000000000000000001523262174200321345ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/src/components/button.ts000066400000000000000000000000571523262174200340210ustar00rootroot00000000000000export function button() { return "button"; }webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/src/index.ts000066400000000000000000000002101523262174200314170ustar00rootroot00000000000000import * as button from "@components/button"; import * as date from "@utils/date"; console.log( "HELLO WORLD!", button, date, ); webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/src/utils/000077500000000000000000000000001523262174200311075ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/src/utils/date.ts000066400000000000000000000000531523262174200323720ustar00rootroot00000000000000export function date() { return "date"; }webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-npm/tsconfig.json000066400000000000000000000001231523262174200316630ustar00rootroot00000000000000{ "extends": ["react/tsconfig"], "compilerOptions": { "baseUrl": "." } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/000077500000000000000000000000001523262174200303065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/000077500000000000000000000000001523262174200327635ustar00rootroot00000000000000@my-tsconfig/000077500000000000000000000000001523262174200352435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modulesbase/000077500000000000000000000000001523262174200361555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfigpackage.json000066400000000000000000000001231523262174200404370ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base{ "name": "@my-tsconfig/base", "version": "1.0.0", "main": "tsconfig.json" } src/000077500000000000000000000000001523262174200367445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/baseutil.ts000066400000000000000000000000321523262174200402640ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base/srcexport const util = true; tsconfig.json000066400000000000000000000001441523262174200406630ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/node_modules/@my-tsconfig/base{ "compilerOptions": { "baseUrl": ".", "paths": { "@pkg/*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-pkg-entry/tsconfig.json000066400000000000000000000000451523262174200330140ustar00rootroot00000000000000{ "extends": "@my-tsconfig/base" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-unscoped-pkg/000077500000000000000000000000001523262174200307655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-unscoped-pkg/node_modules/000077500000000000000000000000001523262174200334425ustar00rootroot00000000000000my-base-config/000077500000000000000000000000001523262174200361635ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-unscoped-pkg/node_modulessrc/000077500000000000000000000000001523262174200367525ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-unscoped-pkg/node_modules/my-base-configutil.ts000066400000000000000000000000341523262174200402740ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-unscoped-pkg/node_modules/my-base-config/srcexport const util = "util"; tsconfig.json000066400000000000000000000001311523262174200406650ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-unscoped-pkg/node_modules/my-base-config{ "compilerOptions": { "baseUrl": ".", "paths": { "@pkg/*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/extends-unscoped-pkg/tsconfig.json000066400000000000000000000000411523262174200334670ustar00rootroot00000000000000{ "extends": "my-base-config" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/000077500000000000000000000000001523262174200276555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/000077500000000000000000000000001523262174200304445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/components/000077500000000000000000000000001523262174200326315ustar00rootroot00000000000000button.ts000066400000000000000000000000401523262174200344270ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/componentsexport const Button = 'button'; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/000077500000000000000000000000001523262174200317125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/bar/000077500000000000000000000000001523262174200324565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/bar/index.ts000066400000000000000000000000321523262174200341300ustar00rootroot00000000000000export const bar = 'bar'; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/foo/000077500000000000000000000000001523262174200324755ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/src/mapped/foo/index.ts000066400000000000000000000000321523262174200341470ustar00rootroot00000000000000export const foo = 'foo'; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/jsonc-comments/tsconfig.json000066400000000000000000000005101523262174200323600ustar00rootroot00000000000000{ // This is a line comment "compilerOptions": { /* This is a block comment */ "baseUrl": ".", "paths": { // Another line comment "@components/*": ["${configDir}/src/components/*"], "foo": ["${configDir}/src/mapped/foo"], /* Block comment in paths */ "bar/*": ["${configDir}/src/mapped/bar/*"], } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/malformed-json/000077500000000000000000000000001523262174200276335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/malformed-json/tsconfig.json000066400000000000000000000003061523262174200323410ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": "./src", "paths": { "@components/*": ["components/*"], // This is a comment which makes JSON invalid "@utils/*": ["utils/*" } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/000077500000000000000000000000001523262174200302655ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/package.json000066400000000000000000000000701523262174200325500ustar00rootroot00000000000000{ "name": "no-baseurl-upward", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/subdir/000077500000000000000000000000001523262174200315555ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/subdir/index.ts000066400000000000000000000000311523262174200332260ustar00rootroot00000000000000import value from "pkg"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/subdir/node_modules/000077500000000000000000000000001523262174200342325ustar00rootroot00000000000000package/000077500000000000000000000000001523262174200355465ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/subdir/node_modulesindex.js000066400000000000000000000000251523262174200372100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/subdir/node_modules/packagemodule.exports = 42; package.json000066400000000000000000000000561523262174200400350ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/subdir/node_modules/package{ "name": "package", "version": "1.0.0" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-baseurl-upward/tsconfig.json000066400000000000000000000001201523262174200327650ustar00rootroot00000000000000{ "compilerOptions": { "target": "ES2017", "module": "commonjs" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-tsconfig/000077500000000000000000000000001523262174200271445ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-tsconfig/src/000077500000000000000000000000001523262174200277335ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/no-tsconfig/src/index.ts000066400000000000000000000000361523262174200314110ustar00rootroot00000000000000export const hello = "world"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/000077500000000000000000000000001523262174200306415ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/a/000077500000000000000000000000001523262174200310615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/a/src/000077500000000000000000000000001523262174200316505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/a/src/index.ts000066400000000000000000000000261523262174200333250ustar00rootroot00000000000000export const a = "a"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/a/tsconfig.json000066400000000000000000000002211523262174200335630ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@a/*": ["./src/*"] }, "composite": true }, "references": [{ "path": "../b" }] } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/b/000077500000000000000000000000001523262174200310625ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/b/src/000077500000000000000000000000001523262174200316515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/b/src/index.ts000066400000000000000000000000261523262174200333260ustar00rootroot00000000000000export const b = "b"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-circular/b/tsconfig.json000066400000000000000000000002211523262174200335640ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@b/*": ["./src/*"] }, "composite": true }, "references": [{ "path": "../a" }] } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/000077500000000000000000000000001523262174200307165ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/main-lib/000077500000000000000000000000001523262174200324065ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/main-lib/foo.ts000066400000000000000000000000361523262174200335400ustar00rootroot00000000000000export const source = "main"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/ref/000077500000000000000000000000001523262174200314725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/ref/ref-lib/000077500000000000000000000000001523262174200330125ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/ref/ref-lib/foo.ts000066400000000000000000000000351523262174200341430ustar00rootroot00000000000000export const source = "ref"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/ref/src/000077500000000000000000000000001523262174200322615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/ref/src/index.ts000066400000000000000000000000131523262174200337320ustar00rootroot00000000000000export {}; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/ref/tsconfig.json000066400000000000000000000002101523262174200341720ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@lib/*": ["./ref-lib/*"] }, "composite": true, "outDir": "./dist" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-priority/tsconfig.json000066400000000000000000000002041523262174200334210ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@lib/*": ["./main-lib/*"] } }, "references": [{ "path": "./ref" }] } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/000077500000000000000000000000001523262174200305035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/000077500000000000000000000000001523262174200322615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/app/000077500000000000000000000000001523262174200330415ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/app/src/000077500000000000000000000000001523262174200336305ustar00rootroot00000000000000components/000077500000000000000000000000001523262174200357365ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/app/srcButton.ts000066400000000000000000000000651523262174200375620ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/app/src/components// Button component export const Button = "Button"; index.ts000066400000000000000000000000631523262174200352270ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/app/srcexport function appMain() { return "app main"; } tsconfig.json000066400000000000000000000003071523262174200354710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/app{ "compilerOptions": { "baseUrl": ".", "paths": { "@app/*": ["${configDir}/src/*"] }, "composite": true, "outDir": "./dist" }, "references": [{ "path": "${configDir}/../shared" }] } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/shared/000077500000000000000000000000001523262174200335275ustar00rootroot00000000000000index.ts000066400000000000000000000000711523262174200351250ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/sharedimport { helper } from "utils/helper"; export { helper };src/000077500000000000000000000000001523262174200342375ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/sharedcomponents/000077500000000000000000000000001523262174200364245ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/shared/srcInput.ts000066400000000000000000000000621523262174200400710ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/shared/src/components// Input component export const Input = "Input"; index.ts000066400000000000000000000000731523262174200357160ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/shared/srcimport { helper } from "@shared/helper"; export { helper };utils/000077500000000000000000000000001523262174200353775ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/shared/srchelper.ts000066400000000000000000000001041523262174200372210ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/shared/src/utilsexport function helper() { return "helper from shared package"; } tsconfig.json000066400000000000000000000003231523262174200361550ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/shared{ "compilerOptions": { "baseUrl": "./src", "paths": { "@shared/*": ["${configDir}/src/utils/*"] }, "composite": true, "outDir": "./dist" }, "references": [{ "path": "${configDir}/../utils" }] } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/utils/000077500000000000000000000000001523262174200334215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/utils/src/000077500000000000000000000000001523262174200342105ustar00rootroot00000000000000core/000077500000000000000000000000001523262174200350615ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/utils/srcdate.ts000066400000000000000000000001201523262174200363370ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/utils/src/coreexport function formatDate(date: Date): string { return date.toISOString(); } tsconfig.json000066400000000000000000000002331523262174200360470ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/packages/utils{ "compilerOptions": { "baseUrl": "./src", "paths": { "@utils/*": ["${configDir}/src/core/*"] }, "composite": true, "outDir": "./dist" } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/src/000077500000000000000000000000001523262174200312725ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/src/main.ts000066400000000000000000000000651523262174200325670ustar00rootroot00000000000000export function rootMain() { return "root main"; } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/references-project/tsconfig.json000066400000000000000000000003101523262174200332040ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@root/*": ["${configDir}/src/*"] } }, "references": [ { "path": "${configDir}/packages/shared" }, { "path": "./packages/app" } ] } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/000077500000000000000000000000001523262174200312675ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/node_modules/000077500000000000000000000000001523262174200337445ustar00rootroot00000000000000@sentry/000077500000000000000000000000001523262174200353115ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/node_modulesreact/000077500000000000000000000000001523262174200364075ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/node_modules/@sentryindex.js000066400000000000000000000000251523262174200400510ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/node_modules/@sentry/reactmodule.exports = {}; package.json000066400000000000000000000001121523262174200406670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/node_modules/@sentry/react{ "name": "@sentry/react", "version": "1.0.0", "main": "index.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/src/000077500000000000000000000000001523262174200320565ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/src/helper/000077500000000000000000000000001523262174200333355ustar00rootroot00000000000000index.ts000066400000000000000000000001311523262174200347300ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/src/helperimport * as sentry from "@sentry/react"; export const helper = true; export { sentry }; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/scoped-pkg-fallthrough/tsconfig.json000066400000000000000000000001401523262174200337710ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@*": ["./src/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/upward-traversal/000077500000000000000000000000001523262174200302215ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/upward-traversal/src/000077500000000000000000000000001523262174200310105ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/upward-traversal/src/app/000077500000000000000000000000001523262174200315705ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/upward-traversal/src/app/index.ts000066400000000000000000000000501523262174200332420ustar00rootroot00000000000000import { helper } from "@utils/helper"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/upward-traversal/src/utils/000077500000000000000000000000001523262174200321505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/upward-traversal/src/utils/helper.ts000066400000000000000000000000401523262174200337710ustar00rootroot00000000000000export const helper = "helper"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/tsconfig-paths/upward-traversal/tsconfig.json000066400000000000000000000001541523262174200327300ustar00rootroot00000000000000{ "compilerOptions": { "baseUrl": ".", "paths": { "@utils/*": ["./src/utils/*"] } } } webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/000077500000000000000000000000001523262174200271735ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/node_modules/000077500000000000000000000000001523262174200316505ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/node_modules/react/000077500000000000000000000000001523262174200327465ustar00rootroot00000000000000index.js000066400000000000000000000000371523262174200343340ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/node_modules/reactmodule.exports = "root-react"; package.json000066400000000000000000000000541523262174200351540ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/node_modules/react{ "name": "react", "main": "index.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/node_modules/shared/000077500000000000000000000000001523262174200331165ustar00rootroot00000000000000index.js000066400000000000000000000000501523262174200344770ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/node_modules/sharedmodule.exports = "root-shared-package"; package.json000066400000000000000000000000551523262174200353250ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/node_modules/shared{ "name": "shared", "main": "index.js" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/package.json000066400000000000000000000000531523262174200314570ustar00rootroot00000000000000{ "name": "unsafe-cache-normalization" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/000077500000000000000000000000001523262174200307515ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nested/000077500000000000000000000000001523262174200322335ustar00rootroot00000000000000node_modules/000077500000000000000000000000001523262174200346315ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nestedreact/000077500000000000000000000000001523262174200357275ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nested/node_modulesindex.js000066400000000000000000000000411523262174200373670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nested/node_modules/reactmodule.exports = "nested-react"; package.json000066400000000000000000000000541523262174200402140ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nested/node_modules/react{ "name": "react", "main": "index.js" } package.json000066400000000000000000000000621523262174200344400ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nested{ "name": "unsafe-cache-normalization-nested" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nested/src/000077500000000000000000000000001523262174200330225ustar00rootroot00000000000000index.js000066400000000000000000000000371523262174200344100ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/packages/nested/srcmodule.exports = "nested-src"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/000077500000000000000000000000001523262174200277625ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/a/000077500000000000000000000000001523262174200302025ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/a/b/000077500000000000000000000000001523262174200304235ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/a/b/index.js000066400000000000000000000000371523262174200320700ustar00rootroot00000000000000module.exports = "root-alpha"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/b/000077500000000000000000000000001523262174200302035ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/b/index.js000066400000000000000000000000361523262174200316470ustar00rootroot00000000000000module.exports = "root-beta"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/components/000077500000000000000000000000001523262174200321475ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/components/index.js000066400000000000000000000000011523262174200336030ustar00rootroot00000000000000 node_modules/000077500000000000000000000000001523262174200345455ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/componentsreact/000077500000000000000000000000001523262174200356435ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/components/node_modulesindex.js000066400000000000000000000000011523262174200372770ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/components/node_modules/react package.json000066400000000000000000000000261523262174200401270ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/components/node_modules/react{ "name": "react" } webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/shared/000077500000000000000000000000001523262174200312305ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/unsafe-cache-normalization/src/shared/index.js000066400000000000000000000000451523262174200326740ustar00rootroot00000000000000module.exports = "root-shared-file"; webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/000077500000000000000000000000001523262174200230735ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/a/000077500000000000000000000000001523262174200233135ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/a/foo-2/000077500000000000000000000000001523262174200242355ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/a/foo-2/b000066400000000000000000000000001523262174200243670ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/a/foo-2/c000066400000000000000000000000001523262174200243700ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/a/foo/000077500000000000000000000000001523262174200240765ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/a/foo/a000066400000000000000000000000001523262174200242270ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/a/foo/b000066400000000000000000000000001523262174200242300ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/b/000077500000000000000000000000001523262174200233145ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/b/foo/000077500000000000000000000000001523262174200240775ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/b/foo/a000066400000000000000000000000001523262174200242300ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/c/000077500000000000000000000000001523262174200233155ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/c/foo/000077500000000000000000000000001523262174200241005ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/c/foo/a000066400000000000000000000000001523262174200242310ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/fixtures/yield/c/foo/package.json000066400000000000000000000001171523262174200263650ustar00rootroot00000000000000{ "name": "foo", "version": "1.0.0", "browser": { "./a": false } } webpack-enhanced-resolve-7dfc9bc/test/forEachBail.test.js000066400000000000000000000030751523262174200235740ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { forEachBail } = require("../"); const { describe, it } = require("./_runner"); describe("forEachBail", () => { it("should iterate correctly", (t, done) => { const log = []; forEachBail( [0, 1, 2, 3, 4, 5, 6], (value, callback) => { log.push(value); if (value % 4 === 0) return callback(null, undefined); if (value % 2 === 0) return callback(); if (value === 5) return callback(null, { path: "test" }); process.nextTick(callback); }, (err, result) => { if (err) return done(err); if (!result) return done(new Error("Should have result")); assert.deepStrictEqual(result, { path: "test" }); assert.deepStrictEqual(log, [0, 1, 2, 3, 4, 5]); done(); }, ); }); it("should handle empty array", (t, done) => { forEachBail( [], () => { done(new Error("Should not be called")); }, (err, result) => { assert.strictEqual(err, undefined); assert.strictEqual(result, undefined); done(); }, ); }); it("should sync finish with undefined", (t, done) => { forEachBail( [2, 3, 4, 5, 6], (value, callback) => callback(), (err, result) => { assert.strictEqual(err, undefined); assert.strictEqual(result, undefined); done(); }, ); }); it("should async finish with undefined", (t, done) => { forEachBail( [2, 3, 4, 5, 6], (value, callback) => { process.nextTick(callback); }, (err, result) => { assert.strictEqual(err, undefined); assert.strictEqual(result, undefined); done(); }, ); }); }); webpack-enhanced-resolve-7dfc9bc/test/fullSpecified.test.js000066400000000000000000000072771523262174200242230ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { Volume } = require("memfs"); const { ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); describe("fullSpecified", () => { const fileSystem = Volume.fromJSON( { "/a/node_modules/package1/index.js": "", "/a/node_modules/package1/file.js": "", "/a/node_modules/package2/package.json": JSON.stringify({ main: "a", }), "/a/node_modules/package2/a.js": "", "/a/node_modules/package3/package.json": JSON.stringify({ main: "dir", }), "/a/node_modules/package3/dir/index.js": "", "/a/node_modules/package4/package.json": JSON.stringify({ browser: { "./a.js": "./b", }, }), "/a/node_modules/package4/a.js": "", "/a/node_modules/package4/b.js": "", "/a/abc.js": "", "/a/dir/index.js": "", "/a/index.js": "", }, "/", ); const resolver = ResolverFactory.createResolver({ alias: { alias1: "/a/abc", alias2: "/a/", }, aliasFields: ["browser"], fullySpecified: true, useSyncFileSystemCalls: true, // @ts-expect-error for test fileSystem, }); const contextResolver = ResolverFactory.createResolver({ alias: { alias1: "/a/abc", alias2: "/a/", }, aliasFields: ["browser"], fullySpecified: true, resolveToContext: true, useSyncFileSystemCalls: true, // @ts-expect-error for test fileSystem, }); const failingResolves = { "no extensions": "./abc", "no extensions (absolute)": "/a/abc", "no extensions in packages": "package1/file", "no directories": ".", "no directories 2": "./", "no directories in packages": "package3/dir", "no extensions in packages 2": "package3/a", }; const pkg = "/a/node_modules/package"; const successfulResolves = { "fully relative": ["./abc.js", "/a/abc.js"], "fully absolute": ["/a/abc.js", "/a/abc.js"], "fully relative in package": ["package1/file.js", `${pkg}1/file.js`], "extensions in mainFiles": ["package1", `${pkg}1/index.js`], "extensions in mainFields": ["package2", `${pkg}2/a.js`], "extensions in alias": ["alias1", "/a/abc.js"], "directories in alias": ["alias2", "/a/index.js"], "directories in packages": ["package3", `${pkg}3/dir/index.js`], "extensions in aliasFields": ["package4/a.js", `${pkg}4/b.js`], }; for (const key of Object.keys(failingResolves)) { const request = failingResolves[key]; it(`should fail resolving ${key}`, () => { assert.throws(() => { resolver.resolveSync({}, "/a", request); }, /Can't resolve/); }); } for (const key of Object.keys(successfulResolves)) { const [request, expected] = successfulResolves[key]; it(`should resolve ${key} successfully`, () => { try { assert.deepStrictEqual( resolver.resolveSync({}, "/a", request), expected, ); } catch (err) { err.message += `\n${err.details}`; throw err; } }); } const successfulContextResolves = { "current folder": [".", "/a"], "current folder 2": ["./", "/a"], "relative directory": ["./dir", "/a/dir"], "relative directory 2": ["./dir/", "/a/dir"], "relative directory with query and fragment": [ "./dir?123#456", "/a/dir?123#456", ], "relative directory with query and fragment 2": [ "./dir/?123#456", "/a/dir?123#456", ], "absolute directory": ["/a/dir", "/a/dir"], "directory in package": ["package3/dir", `${pkg}3/dir`], }; for (const key of Object.keys(successfulContextResolves)) { const [request, expected] = successfulContextResolves[key]; it(`should resolve ${key} successfully to an context`, () => { try { assert.deepStrictEqual( contextResolver.resolveSync({}, "/a", request), expected, ); } catch (err) { err.message += `\n${err.details}`; throw err; } }); } }); webpack-enhanced-resolve-7dfc9bc/test/getPaths.test.js000066400000000000000000000045651523262174200232210ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const getPaths = require("../lib/getPaths"); const { getPathsCached } = require("../lib/getPaths"); const { describe, it } = require("./_runner"); /** * @type {[string, { paths: string[], segments: string[] }][]} */ const cases = [ ["/a", { paths: ["/a", "/"], segments: ["a", "/"] }], ["/a/", { paths: ["/a/", "/a", "/"], segments: ["", "a", "/"] }], ["/a/b", { paths: ["/a/b", "/a", "/"], segments: ["b", "a", "/"] }], [ "/a/b/", { paths: ["/a/b/", "/a/b", "/a", "/"], segments: ["", "b", "a", "/"] }, ], ["/", { paths: ["/"], segments: [""] }], ]; describe("get paths", () => { for (const case_ of cases) { it(case_[0], () => { const { paths, segments } = getPaths(case_[0]); assert.deepStrictEqual(paths, case_[1].paths); assert.deepStrictEqual(segments, case_[1].segments); }); } }); describe("getPathsCached", () => { it("returns identical arrays on cache hit per-fs", () => { const fs = /** @type {import("../lib/Resolver").FileSystem} */ ({}); const a = getPathsCached(fs, "/a/b/c"); const b = getPathsCached(fs, "/a/b/c"); // Same cached object — paths/segments arrays are shared. assert.strictEqual(a, b); assert.strictEqual(a.paths, b.paths); assert.strictEqual(a.segments, b.segments); }); it("still returns correct values after cache miss", () => { const fs = /** @type {import("../lib/Resolver").FileSystem} */ ({}); assert.deepStrictEqual(getPathsCached(fs, "/a/b").paths, [ "/a/b", "/a", "/", ]); assert.deepStrictEqual(getPathsCached(fs, "/x/y/z").paths, [ "/x/y/z", "/x/y", "/x", "/", ]); }); it("handles the root-only input", () => { const fs = /** @type {import("../lib/Resolver").FileSystem} */ ({}); const a = getPathsCached(fs, "/"); const b = getPathsCached(fs, "/"); assert.strictEqual(a, b); assert.deepStrictEqual(a.paths, ["/"]); assert.deepStrictEqual(a.segments, [""]); }); it("keeps caches independent across filesystems", () => { const fsA = /** @type {import("../lib/Resolver").FileSystem} */ ({}); const fsB = /** @type {import("../lib/Resolver").FileSystem} */ ({}); const first = getPathsCached(fsA, "/p/q"); const second = getPathsCached(fsB, "/p/q"); // Values equal but not the same object — separate cache namespaces. assert.notStrictEqual(first, second); assert.deepStrictEqual(first.paths, second.paths); }); }); webpack-enhanced-resolve-7dfc9bc/test/identifier.test.js000066400000000000000000000141451523262174200235570ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { createResolver } = require("../lib/ResolverFactory"); const { parseIdentifier } = require("../lib/util/identifier"); const { describe, it } = require("./_runner"); /** * @typedef {{ input: string, expected: [string, string, string] }} TestSuite */ describe("identifier", () => { /** * @param {TestSuite[]} suites suites */ function run(suites) { for (const { input, expected } of suites) { it(input, () => { const parsed = parseIdentifier(input); if (!parsed) throw new Error("should not be null"); assert.deepStrictEqual(parsed, expected); }); } } describe("parse identifier. edge cases", () => { /** @type {TestSuite[]} */ const tests = [ { input: "path/#", expected: ["path/", "", "#"], }, { input: "path/as/?", expected: ["path/as/", "?", ""], }, { input: "path/#/?", expected: ["path/", "", "#/?"], }, { input: "path/#repo#hash", expected: ["path/", "", "#repo#hash"], }, { input: "path/#r#hash", expected: ["path/", "", "#r#hash"], }, { input: "path/#repo/#repo2#hash", expected: ["path/", "", "#repo/#repo2#hash"], }, { input: "path/#r/#r#hash", expected: ["path/", "", "#r/#r#hash"], }, { input: "path/#/not/a/hash?not-a-query", expected: ["path/", "", "#/not/a/hash?not-a-query"], }, { input: "#\0?\0#ab\0\0c?\0#\0\0query#?#\0fragment", expected: ["#?#ab\0c", "?#\0query", "#?#\0fragment"], }, ]; run(tests); }); // Tests for https://github.com/webpack/webpack/issues/16819 // To embed a literal '#' in a filesystem path, the caller must use the // '\0#' null-byte escape. Unescaped '#' always starts a fragment. describe("parse identifier. '#' escape with \\0", () => { /** @type {TestSuite[]} */ const tests = [ // '\0#' in path is unescaped to '#' (part of directory name), no fragment { input: "/home/user/projects/test\0#/webpack/src/file.js", expected: ["/home/user/projects/test#/webpack/src/file.js", "", ""], }, // '\0#' dir name, with a real (unescaped) '#' fragment at the end { input: "/projects/test\0#app/src/file.js#fragment", expected: ["/projects/test#app/src/file.js", "", "#fragment"], }, // Multiple '\0#' escapes in dir names, then a real fragment { input: "/a\0#b/c\0#d/file.js#hash", expected: ["/a#b/c#d/file.js", "", "#hash"], }, // '\0#' dir name with both query and fragment { input: "/projects/test\0#app/file.js?query#fragment", expected: ["/projects/test#app/file.js", "?query", "#fragment"], }, // Unescaped '#' mid-segment is still treated as a fragment start // (callers must escape '#' in paths via '\0#' — see webpack#16819) { input: "/home/user/projects/test#/webpack/src/file.js", expected: ["/home/user/projects/test", "", "#/webpack/src/file.js"], }, ]; run(tests); }); describe("parse identifier. Windows-like paths", () => { /** @type {TestSuite[]} */ const tests = [ { input: "path\\#", expected: ["path\\", "", "#"], }, { input: "C:path\\as\\?", expected: ["C:path\\as\\", "?", ""], }, { input: "path\\#\\?", expected: ["path\\", "", "#\\?"], }, { input: "path\\#repo#hash", expected: ["path\\", "", "#repo#hash"], }, { input: "path\\#r#hash", expected: ["path\\", "", "#r#hash"], }, { input: "path\\#/not/a/hash?not-a-query", expected: ["path\\", "", "#/not/a/hash?not-a-query"], }, // Regression (webpack#16819): '\0#' null-byte escape correctly // embeds '#' in a Windows dir name (no fragment produced) { input: "C:\\Users\\test\0#proj\\webpack\\src\\file.js", expected: ["C:\\Users\\test#proj\\webpack\\src\\file.js", "", ""], }, // Without escaping, '#' still starts a fragment (caller must escape) { input: "C:\\Users\\test#proj\\webpack\\src\\file.js", expected: ["C:\\Users\\test", "", "#proj\\webpack\\src\\file.js"], }, ]; run(tests); }); describe("parse identifier. DOS device paths", () => { /** @type {TestSuite[]} */ const tests = [ // The literal `?` inside `\\?\` is part of the prefix, not a query // separator. Same for the `.` in `\\.\`. { input: "\\\\?\\C:\\foo", expected: ["\\\\?\\C:\\foo", "", ""], }, { input: "\\\\.\\C:\\foo", expected: ["\\\\.\\C:\\foo", "", ""], }, { input: "\\\\?\\UNC\\server\\share\\file.js", expected: ["\\\\?\\UNC\\server\\share\\file.js", "", ""], }, // Query/fragment past the prefix are still parsed normally. { input: "\\\\?\\C:\\foo?bar=1", expected: ["\\\\?\\C:\\foo", "?bar=1", ""], }, { input: "\\\\?\\C:\\foo#frag", expected: ["\\\\?\\C:\\foo", "", "#frag"], }, { input: "\\\\?\\C:\\foo?q=1#f", expected: ["\\\\?\\C:\\foo", "?q=1", "#f"], }, // `\\foo` (plain UNC-ish, not a DOS device path) should not trigger // the prefix skip — its `?` would still be a query separator. We // don't have one to test that the fallback still works unchanged. { input: "\\\\server\\share\\file.js", expected: ["\\\\server\\share\\file.js", "", ""], }, ]; run(tests); }); describe("parse identifier. malformed inputs", () => { it("returns null for a single null-byte input (regex no-match)", () => { assert.strictEqual(parseIdentifier("\0"), null); }); it("returns null for an empty input", () => { assert.strictEqual(parseIdentifier(""), null); }); }); describe("Resolver.parse() output shape", () => { // ParsePlugin manually assigns these fields instead of spreading // the parse() result (see lib/ParsePlugin.js). If parse() gains or // loses a field, this test will fail — update ParsePlugin to match. it("should return exactly the expected keys", () => { const resolver = createResolver({ fileSystem: /** @type {import("../lib/Resolver").FileSystem} */ ({}), }); const parsed = resolver.parse("foo"); const keys = Object.keys(parsed).sort(); assert.deepStrictEqual(keys, [ "directory", "file", "fragment", "internal", "module", "query", "request", ]); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/importsField.test.js000066400000000000000000001175421523262174200241030ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const ResolverFactory = require("../lib/ResolverFactory"); const { processImportsField } = require("../lib/util/entrypoints"); const { describe, it } = require("./_runner"); /** @typedef {import("../lib/util/entrypoints").ImportsField} ImportsField */ const fixture = path.resolve(__dirname, "fixtures", "imports-field"); const fixture1 = path.resolve(__dirname, "fixtures", "imports-field-different"); describe("process imports field", () => { /** @type {{ name: string, expect: string[] | Error, suite: [ImportsField, string, string[]] }[]} */ const testCases = [ // #region Samples { name: "sample #1", expect: ["./dist/test/file.js", "./src/test/file.js"], suite: [ { "#abc/": { import: ["./dist/", "./src/"], webpack: "./wp/", }, "#abc": "./main.js", }, "#abc/test/file.js", ["import", "webpack"], ], }, { name: "sample #2", expect: ["./data/timezones/pdt.mjs"], suite: [ { "#1/timezones/": "./data/timezones/", }, "#1/timezones/pdt.mjs", [], ], }, { name: "sample #3", // mapping works like concatenating strings not file paths expect: ["./data/timezones/timezones/pdt.mjs"], suite: [ { "#aaa/": "./data/timezones/", "#a/": "./data/timezones/", }, "#a/timezones/pdt.mjs", [], ], }, { name: "sample #4", expect: [], suite: [ { "#a/lib/": { browser: ["./browser/"], }, "#a/dist/index.js": { node: "./index.js", }, }, "#a/dist/index.js", ["browser"], ], }, { name: "sample #5", expect: ["./browser/index.js"], // default condition used suite: [ { "#a/lib/": { browser: ["./browser/"], }, "#a/dist/index.js": { node: "./index.js", default: "./browser/index.js", }, }, "#a/dist/index.js", ["browser"], ], }, { name: "sample #6", expect: [], suite: [ { "#a/dist/a": "./dist/index.js", }, "#a/dist/aaa", [], ], }, { name: "sample #7", expect: [], suite: [ { "#a/a/a/": "./dist/index.js", }, "#a/a/a", [], ], }, { name: "sample #8", expect: [], suite: [ { "#a": "./index.js", }, "#a/timezones/pdt.mjs", [], ], }, { name: "sample #9", expect: ["./main.js"], suite: [ { "#a/index.js": "./main.js", }, "#a/index.js", [], ], }, { name: "sample #10", expect: ["./ok.js"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/#foo", [], ], }, { name: "sample #11", expect: ["./ok.js"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/bar#foo", [], ], }, { name: "sample #12", expect: ["./ok.js#abc"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/#zapp/ok.js#abc", [], ], }, { name: "sample #13", expect: ["./ok.js?abc"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/#zapp/ok.js?abc", [], ], }, { name: "sample #14", expect: ["./🎉.js"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/#zapp/🎉.js", [], ], }, { name: "sample #15", expect: ["./%F0%9F%8E%89.js"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, // "🎉" percent encoded "#a/#zapp/%F0%9F%8E%89.js", [], ], }, { name: "sample #16", expect: ["./ok.js"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/🎉", [], ], }, { name: "sample #17", expect: ["./other.js"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/%F0%9F%8E%89", [], ], }, { name: "sample #18", expect: ["./ok.js"], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/module", [], ], }, { name: "sample #19", expect: [], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/module#foo", [], ], }, { name: "sample #20", expect: [], suite: [ { "#a/#foo": "./ok.js", "#a/module": "./ok.js", "#a/🎉": "./ok.js", "#a/%F0%9F%8E%89": "./other.js", "#a/bar#foo": "./ok.js", "#a/#zapp/": "./", }, "#a/module?foo", [], ], }, { name: "sample #21", expect: ["./d?e?f"], suite: [ { "#a/a?b?c/": "./", }, "#a/a?b?c/d?e?f", [], ], }, { name: "sample #22", expect: ["/user/a/index"], suite: [ { "#a/": "/user/a/", }, "#a/index", [], ], }, { name: "path tree edge case #1", expect: ["./A/b/d.js"], suite: [ { "#a/": "./A/", "#a/b/c": "./c.js", }, "#a/b/d.js", [], ], }, { name: "path tree edge case #2", expect: ["./A/c.js"], suite: [ { "#a/": "./A/", "#a/b": "./b.js", }, "#a/c.js", [], ], }, { name: "path tree edge case #3", expect: ["./A/b/c/d.js"], suite: [ { "#a/": "./A/", "#a/b/c/d": "./c.js", }, "#a/b/c/d.js", [], ], }, // #endregion // #region Direct mapping { name: "Direct mapping #1", expect: ["./dist/index.js"], suite: [ { "#a": "./dist/index.js", }, "#a", [], ], }, { name: "Direct mapping #2", expect: [], suite: [ { "#a/": "./", }, "#a", [], ], }, { name: "Direct mapping #3", expect: ["./dist/a.js"], // direct mapping is more prioritize suite: [ { "#a/": "./dist/", "#a/index.js": "./dist/a.js", }, "#a/index.js", [], ], }, { name: "Direct mapping #4", expect: ["./index.js"], // direct mapping is more prioritize suite: [ { "#a/": { browser: ["./browser/"], }, "#a/index.js": { browser: "./index.js", }, }, "#a/index.js", ["browser"], ], }, { name: "Direct mapping #5", // direct mapping is more prioritize, // so there is no match expect: [], suite: [ { "#a/": { browser: ["./browser/"], }, "#a/index.js": { node: "./node.js", }, }, "#a/index.js", ["browser"], ], }, { name: "Direct mapping #6", expect: ["./index.js"], suite: [ { "#a": { browser: "./index.js", node: "./src/node/index.js", default: "./src/index.js", }, }, "#a", ["browser"], ], }, { name: "Direct mapping #7", expect: ["./src/index.js"], // Default is first one suite: [ { "#a": { default: "./src/index.js", browser: "./index.js", node: "./src/node/index.js", }, }, "#a", ["browser"], ], }, { name: "Direct mapping #8", expect: ["./src/index.js"], suite: [ { "#a": { browser: "./index.js", node: "./src/node/index.js", default: "./src/index.js", }, }, "#a", [], ], }, { name: "Direct mapping #9", expect: ["./index"], // it is fine, file may not have extension suite: [ { "#a": "./index", }, "#a", [], ], }, { name: "Direct mapping #10", expect: ["./index.js"], suite: [ { "#a/index": "./index.js", }, "#a/index", [], ], }, { name: "Direct mapping #11", expect: ["b"], suite: [ { "#a": "b", }, "#a", [], ], }, { name: "Direct mapping #12", expect: ["b/index"], suite: [ { "#a/": "b/", }, "#a/index", [], ], }, { name: "Direct mapping #13", expect: ["b#anotherhashishere"], suite: [ { "#a?q=a#hashishere": "b#anotherhashishere", }, "#a?q=a#hashishere", [], ], }, // #endregion // #region Direct and conditional mapping { name: "Direct and conditional mapping #1", expect: [], suite: [ { "#a": [ { browser: "./browser.js" }, { require: "./require.js" }, { import: "./import.mjs" }, ], }, "#a", [], ], }, { name: "Direct and conditional mapping #2", expect: ["./import.mjs"], suite: [ { "#a": [ { browser: "./browser.js" }, { require: "./require.js" }, { import: "./import.mjs" }, ], }, "#a", ["import"], ], }, { name: "Direct and conditional mapping #3", expect: ["./require.js", "./import.mjs"], suite: [ { "#a": [ { browser: "./browser.js" }, { require: "./require.js" }, { import: "./import.mjs" }, ], }, "#a", ["import", "require"], ], }, { name: "Direct and conditional mapping #4", expect: ["./require.js", "./import.mjs", "#b/import.js"], suite: [ { "#a": [ { browser: "./browser.js" }, { require: ["./require.js"] }, { import: ["./import.mjs", "#b/import.js"] }, ], }, "#a", ["import", "require"], ], }, // #endregion // #region When mapping to a folder root, both the left and right sides must end in slashes { name: "mapping to a folder root #1", expect: [], suite: [ { "#timezones": "./data/timezones/", }, "#timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #2", expect: new Error( 'Expecting folder to folder mapping. "./data/timezones" should end with "/"', ), suite: [ { "#timezones/": "./data/timezones", }, "#timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #3", expect: ["./data/timezones/pdt/index.mjs"], suite: [ { "#timezones/pdt/": "./data/timezones/pdt/", }, "#timezones/pdt/index.mjs", [], ], }, { name: "mapping to a folder root #4", expect: ["./timezones/pdt.mjs"], suite: [ { "#a/": "./timezones/", }, "#a/pdt.mjs", [], ], }, { name: "mapping to a folder root #5", expect: ["./timezones/pdt.mjs"], suite: [ { "#a/": "./", }, "#a/timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #6", expect: new Error( 'Expecting folder to folder mapping. "." should end with "/"', ), suite: [ { "#a/": ".", }, "#a/timezones/pdt.mjs", [], ], }, { name: "mapping to a folder root #7", expect: [], // incorrect export field, but value did not processed suite: [ { "#a": "./", }, "#a/timezones/pdt.mjs", [], ], }, // #endregion // #region The longest matching path prefix is prioritized { name: "the longest matching path prefix is prioritized #1", // it does not work same as conditional mapping, // so there is no match for ./dist/index.mjs expect: ["./lib/index.mjs"], suite: [ { "#a/": "./", "#a/dist/": "./lib/", }, "#a/dist/index.mjs", [], ], }, { name: "the longest matching path prefix is prioritized #2", expect: ["./dist/utils/index.js"], suite: [ { "#a/dist/utils/": "./dist/utils/", "#a/dist/": "./lib/", }, "#a/dist/utils/index.js", [], ], }, { name: "the longest matching path prefix is prioritized #3", // direct mapping is prioritize // it does not work same as conditional mapping, // so there is no match for ./dist/utils/index.mjs expect: ["./dist/utils/index.js"], suite: [ { "#a/dist/utils/index.js": "./dist/utils/index.js", "#a/dist/utils/": "./dist/utils/index.mjs", "#a/dist/": "./lib/", }, "#a/dist/utils/index.js", [], ], }, { name: "the longest matching path prefix is prioritized #4", // it does not work same as conditional mapping, // even if right side is a conditional mapping, // so there is no match for ./browser/dist/index.mjs expect: ["./lib/index.mjs"], suite: [ { "#a/": { browser: "./browser/", }, "#a/dist/": "./lib/", }, "#a/dist/index.mjs", ["browser"], ], }, // #endregion // #region Conditional mapping folder { name: "conditional mapping folder #1", expect: ["lodash/index.js", "./utils/index.js"], suite: [ { "#a/": { browser: ["lodash/", "./utils/"], node: ["./utils-node/"], }, }, "#a/index.js", ["browser"], ], }, { name: "conditional mapping folder #2", expect: [], // no condition names suite: [ { "#a/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], node: ["./node/"], }, }, "#a/index.mjs", [], ], }, { name: "conditional mapping folder #3", expect: ["./wpk/index.mjs"], suite: [ { "#a/": { webpack: "./wpk/", browser: ["lodash/", "./utils/"], node: ["./utils/"], }, }, "#a/index.mjs", ["browser", "webpack"], ], }, // #endregion // #region Incorrect imports field definition { name: "incorrect exports field #1", expect: [], suite: [ { "#a/index": "./a/index.js", }, "#a/index.mjs", [], ], }, { name: "incorrect exports field #2", expect: [], suite: [ { "#a/index.mjs": "./a/index.js", }, "#a/index", [], ], }, { name: "incorrect exports field #3", expect: [], suite: [ { "#a/index": { browser: "./a/index.js", default: "./b/index.js", }, }, "#a/index.mjs", ["browser"], ], }, { name: "incorrect exports field #4", expect: [], suite: [ { "#a/index.mjs": { browser: "./a/index.js", default: "./b/index.js", }, }, "#a/index", ["browser"], ], }, // #endregion // #region Incorrect request { name: "incorrect request #1", expect: new Error('Request should start with "#"'), suite: [ { "#a/": "./a/", }, "/utils/index.mjs", [], ], }, { name: "incorrect request #2", expect: new Error('Request should start with "#"'), suite: [ { "#a/": { browser: "./a/", default: "./b/", }, }, "./utils/index.mjs", ["browser"], ], }, { name: "incorrect request #3", expect: new Error("Request should have at least 2 characters"), suite: [ { "#a/": { browser: "./a/", default: "./b/", }, }, "#", ["browser"], ], }, { name: "incorrect request #4", // Note: #/ patterns are now allowed per Node.js PR #60864 // but #/ alone still fails because it ends with "/" (requesting directory) expect: new Error("Only requesting file allowed"), suite: [ { "#a/": { browser: "./a/", default: "./b/", }, }, "#/", ["browser"], ], }, { name: "incorrect request #5", expect: new Error("Only requesting file allowed"), suite: [ { "#a/": { browser: "./a/", default: "./b/", }, }, "#a/", ["browser"], ], }, // #endregion // #region #/ slash pattern (node.js PR #60864) // These tests cover the new Node.js behavior that allows #/ patterns // See: https://github.com/nodejs/node/pull/60864 { name: "#/ slash pattern #1", // #/* pattern should map #/utils.js to ./src/utils.js expect: ["./src/utils.js"], suite: [ { "#/*": "./src/*", }, "#/utils.js", [], ], }, { name: "#/ slash pattern #2", // #/* pattern should map #/nested/deep.js to ./src/nested/deep.js expect: ["./src/nested/deep.js"], suite: [ { "#/*": "./src/*", }, "#/nested/deep.js", [], ], }, { name: "#/ slash pattern #3", // #/main direct mapping (starts with #/ but is not a wildcard) expect: ["./main.js"], suite: [ { "#/main": "./main.js", }, "#/main", [], ], }, { name: "#/ slash pattern #4", // Conditional mapping with #/* pattern expect: ["./browser/utils.js"], suite: [ { "#/*": { browser: "./browser/*", default: "./src/*", }, }, "#/utils.js", ["browser"], ], }, { name: "#/ slash pattern #5", // #/lib/ subpath folder mapping (legacy syntax with #/ prefix) expect: ["./lib/utils.js"], suite: [ { "#/lib/": "./lib/", }, "#/lib/utils.js", [], ], }, { name: "#/ slash pattern #6", // Symmetric exports/imports pattern as shown in Node.js PR expect: ["./src/index.js"], suite: [ { "#/*": "./src/*", }, "#/index.js", [], ], }, // #endregion // #region Directory imports targets may backtrack above the package base { name: "backtracking package base #1", expect: ["./dist/index"], // we don't handle backtracking here suite: [ { "#a/../../utils/": "./dist/", }, "#a/../../utils/index", [], ], }, { name: "backtracking package base #2", expect: ["./dist/../../utils/index"], suite: [ { "#a/": "./dist/", }, "#a/../../utils/index", [], ], }, { name: "backtracking package base #3", expect: ["../src/index"], suite: [ { "#a/": "../src/", }, "#a/index", [], ], }, { name: "backtracking package base #4", expect: ["./utils/../../../index"], suite: [ { "#a/": { browser: "./utils/../../../", }, }, "#a/index", ["browser"], ], }, // #endregion // #region Imports targets cannot map into a nested node_modules path { name: "nested node_modules path #1", expect: ["moment/node_modules/lodash/dist/index.js"], // we don't handle node_modules here suite: [ { "#a/": { browser: "moment/node_modules/", }, }, "#a/lodash/dist/index.js", ["browser"], ], }, { name: "nested node_modules path #2", expect: ["../node_modules/lodash/dist/index.js"], suite: [ { "#a/": "../node_modules/", }, "#a/lodash/dist/index.js", [], ], }, // #endregion // #region Nested mapping { name: "nested mapping #1", expect: [], suite: [ { "#a/": { browser: { webpack: "./", default: { node: "./node/", }, }, }, }, "#a/index.js", ["browser"], ], }, { name: "nested mapping #2", expect: ["./index.js", "./node/index.js"], suite: [ { "#a/": { browser: { webpack: ["./", "./node/"], default: { node: "./node/", }, }, }, }, "#a/index.js", ["browser", "webpack"], ], }, { name: "nested mapping #3", expect: [], // no browser condition name suite: [ { "#a/": { browser: { webpack: ["./", "./node/"], default: { node: "./node/", }, }, }, }, "#a/index.js", ["webpack"], ], }, { name: "nested mapping #4", expect: ["moment/node/index.js"], suite: [ { "#a/": { browser: { webpack: ["./", "./node/"], default: { node: "moment/node/", }, }, }, }, "#a/index.js", ["node", "browser"], ], }, { name: "nested mapping #5", expect: [], suite: [ { "#a/": { browser: { webpack: ["./", "./node/"], default: { node: { webpack: ["./wpck/"], }, }, }, }, }, "#a/index.js", ["browser", "node"], ], }, { name: "nested mapping #6", expect: ["./index.js", "./node/index.js"], suite: [ { "#a/": { browser: { webpack: ["./", "./node/"], default: { node: { webpack: ["./wpck/"], }, }, }, }, }, "#a/index.js", ["browser", "node", "webpack"], ], }, { name: "nested mapping #7", expect: ["./y.js"], suite: [ { "#a": { abc: { def: "./x.js" }, ghi: "./y.js", }, }, "#a", ["abc", "ghi"], ], }, { name: "nested mapping #8", expect: [], suite: [ { "#a": { abc: { def: "./x.js", default: [] }, ghi: "./y.js", }, }, "#a", ["abc", "ghi"], ], }, // #endregion ]; for (const testCase of testCases) { it(testCase.name, () => { if (testCase.expect instanceof Error) { const { message } = testCase.expect; assert.throws( () => processImportsField(testCase.suite[0])( testCase.suite[1], new Set(testCase.suite[2]), ), (err) => err instanceof Error && err.message.includes(message), ); } else { assert.deepStrictEqual( processImportsField(testCase.suite[0])( testCase.suite[1], new Set(testCase.suite[2]), )[0], testCase.expect, ); } }); } }); describe("importsFieldPlugin", () => { const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFiles: ["index.js"], conditionNames: ["webpack"], }); it("should resolve using imports field instead of self-referencing", (t, done) => { resolver.resolve({}, fixture, "#imports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "b.js")); done(); }); }); it("should resolve using imports field instead of self-referencing for a subpath", (t, done) => { resolver.resolve( {}, path.resolve(fixture, "dir"), "#imports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "b.js")); done(); }, ); }); it("should disallow resolve out of package scope", (t, done) => { resolver.resolve({}, fixture, "#b", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "imports" target "\.\.\/b\.js" defined for "#b"/, ); done(); }); }); it("field name #1", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFiles: ["index.js"], importsFields: [["imports"]], conditionNames: ["webpack"], }); resolver.resolve({}, fixture, "#imports-field", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "b.js")); done(); }); }); it("field name #2", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFiles: ["index.js"], importsFields: [["other", "imports"], "imports"], conditionNames: ["webpack"], }); resolver.resolve({}, fixture, "#b", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture, "a.js")); done(); }); }); it("should resolve package #1", (t, done) => { resolver.resolve({}, fixture, "#a/dist/main.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/a/lib/main.js"), ); done(); }); }); it("should resolve package #2", (t, done) => { resolver.resolve({}, fixture, "#a", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /is not imported from package/); done(); }); }); it("should resolve package #3", (t, done) => { resolver.resolve({}, fixture, "#ccc/index.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/c/index.js"), ); done(); }); }); it("should resolve package #4", (t, done) => { resolver.resolve({}, fixture, "#c", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/c/index.js"), ); done(); }); }); it("should resolve absolute path as an imports field target", (t, done) => { const tmpdirPrefix = path.join(fixture, "node_modules/absolute-tmp-"); fs.mkdtemp(tmpdirPrefix, (err, dir) => { if (err) done(err); const pjson = path.resolve(dir, "./package.json"); const file = path.resolve(dir, "./index"); fs.writeFileSync(file, ""); fs.writeFileSync(pjson, JSON.stringify({ imports: { "#a": file } })); resolver.resolve({}, dir, "#a", {}, (err, result) => { fs.unlinkSync(file); fs.unlinkSync(pjson); fs.rmdirSync(dir); if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, file); done(); }); }); }); it("should log the correct info", (t, done) => { const log = []; resolver.resolve( {}, fixture, "#a/dist/index.js", { log: (v) => log.push(v) }, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(fixture, "node_modules/a/lib/index.js"), ); assert.deepStrictEqual( log.map((line) => line.replace(fixture, "...").replace(/\\/g, "/")), [ "resolve '#a/dist/index.js' in '...'", " using description file: .../package.json (relative path: .)", " resolve as internal import", " using imports field: a/dist/index.js", " Parsed request is a module", " using description file: .../package.json (relative path: .)", " resolve as module", " looking for modules in .../node_modules", " existing directory .../node_modules/a", " using description file: .../node_modules/a/package.json (relative path: .)", " using exports field: ./lib/index.js", " using description file: .../node_modules/a/package.json (relative path: ./lib/index.js)", " no extension", " existing file: .../node_modules/a/lib/index.js", " reporting result .../node_modules/a/lib/index.js", ], ); done(); }, ); }); it("should resolve with wildcard pattern", (t, done) => { const fixture = path.resolve( __dirname, "./fixtures/imports-exports-wildcard/node_modules/m/", ); resolver.resolve({}, fixture, "#internal/i.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./src/internal/i.js"), ); done(); }); }); it("resolver should respect query parameters #1", (t, done) => { resolver.resolve({}, fixture, "#a/dist/main.js?foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/a/lib/main.js?foo"), ); done(); }); }); it("resolver should respect query parameters #2. Direct matching", (t, done) => { resolver.resolve({}, fixture, "#imports-field?foo", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /is not imported from package/); done(); }); }); it("resolver should respect fragment parameters #1", (t, done) => { resolver.resolve({}, fixture, "#a/dist/main.js#foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/a/lib/main.js#foo"), ); done(); }); }); it("resolver should respect fragment parameters #2. Direct matching", (t, done) => { resolver.resolve({}, fixture, "#imports-field#foo", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /is not imported from package/); done(); }); }); it("resolver should respect query and fragment parameters together", (t, done) => { resolver.resolve( {}, fixture, "#a/dist/main.js?foo=bar#frag", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/a/lib/main.js?foo=bar#frag"), ); done(); }, ); }); it("should work and throw an error on invalid imports #1", (t, done) => { // Note: #/ patterns are now allowed per Node.js PR #60864 // #/dep will now try to resolve but fail because there's no mapping resolver.resolve({}, fixture, "#/dep", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /is not imported from package/); done(); }); }); it("should work and throw an error on invalid imports #2", (t, done) => { resolver.resolve({}, fixture, "#dep/", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Resolving to directories is not possible with the imports field \(request was #dep\/\)/, ); done(); }); }); it("should work with invalid imports #1", (t, done) => { resolver.resolve({}, fixture1, "#dep", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.strictEqual(result, `${path.resolve(fixture1, "./a.js")}?foo=../`); done(); }); }); it("should work with invalid imports #2", (t, done) => { resolver.resolve({}, fixture1, "#dep/foo/a.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.strictEqual( result, `${path.resolve(fixture1, "./a.js")}?foo=../#../`, ); done(); }); }); it("should work with invalid imports #3", (t, done) => { resolver.resolve({}, fixture1, "#dep/bar", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve '#dep\/bar' in/); done(); }); }); it("should work with invalid imports #4", (t, done) => { resolver.resolve({}, fixture1, "#dep/baz", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve '#dep\/baz' in/); done(); }); }); it("should work with invalid imports #5", (t, done) => { resolver.resolve({}, fixture1, "#dep/baz-multi", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve '#dep\/baz-multi' in/); done(); }); }); it("should work with invalid imports #6", (t, done) => { resolver.resolve({}, fixture1, "#dep/baz-multi", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve '#dep\/baz-multi' in/); done(); }); }); it("should work with invalid imports #7", (t, done) => { resolver.resolve({}, fixture1, "#dep/pattern/a.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve '#dep\/pattern\/a.js' in/); done(); }); }); it("should work with invalid imports #8", (t, done) => { resolver.resolve({}, fixture1, "#dep/array", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture1, "./a.js")); done(); }); }); it("should work with invalid imports #9", (t, done) => { resolver.resolve({}, fixture1, "#dep/array2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve '#dep\/array2' in/); done(); }); }); it("should work with invalid imports #10", (t, done) => { resolver.resolve({}, fixture1, "#dep/array3", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture1, "./a.js")); done(); }); }); it("should work with invalid imports #11", (t, done) => { resolver.resolve({}, fixture1, "#dep/empty", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Can't resolve '#dep\/empty' in/); done(); }); }); it("should work with invalid imports #12", (t, done) => { resolver.resolve({}, fixture1, "#dep/with-bad", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture1, "./a.js")); done(); }); }); it("should work with invalid imports #13", (t, done) => { resolver.resolve({}, fixture1, "#dep/with-bad2", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture1, "./a.js")); done(); }); }); it("should work with invalid imports #14", (t, done) => { resolver.resolve({}, fixture1, "#timezones/pdt.mjs", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match(err.message, /Expecting folder to folder mapping/); done(); }); }); it("should work with invalid imports #15", (t, done) => { resolver.resolve({}, fixture1, "#dep/multi1", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "imports" target "\.\.\/\.\.\/test\/foo" defined for "#dep\/multi1"/, ); done(); }); }); it("should work with invalid imports #16", (t, done) => { resolver.resolve({}, fixture1, "#dep/multi2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "imports" target "\.\.\/\.\.\/test" defined for "#dep\/multi2"/, ); done(); }); }); it("should work with invalid imports #17", (t, done) => { resolver.resolve({}, fixture1, "#dep/multi1", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "imports" target "\.\.\/\.\.\/test\/foo" defined for "#dep\/multi1"/, ); done(); }); }); it("should work with invalid imports #18", (t, done) => { resolver.resolve({}, fixture1, "#dep/multi2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); assert.match( err.message, /Invalid "imports" target "\.\.\/\.\.\/test" defined for "#dep\/multi2"/, ); done(); }); }); it("should work and resolve with array imports", (t, done) => { resolver.resolve({}, fixture1, "#dep/multi", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixture1, "./a.js")); done(); }); }); it("should work and resolve an imports-field key to a real file", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], conditionNames: ["node"], importsFields: ["imports"], fileSystem: nodeFileSystem, }); resolver.resolve( {}, path.join( path.join(__dirname, "fixtures"), "imports-field-error-trigger", ), "#trigger", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.join( path.join(__dirname, "fixtures"), "imports-field-error-trigger/resolved.js", ), ); done(); }, ); }); it("should throw errors for # requests without a description file in scope", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], conditionNames: ["node"], importsFields: ["imports"], fileSystem: nodeFileSystem, }); resolver.resolve({}, "/tmp", "#not-in-scope", {}, (err) => { assert.ok(err instanceof Error); done(); }); }); // Test for spec compliance: non-relative imports targets should not // re-enter imports resolution (Node.js uses PACKAGE_RESOLVE for these, // which only does node_modules lookup). // See: https://github.com/orgs/webpack/discussions/20684 describe("should not chain imports resolution for non-relative targets", () => { const chainedFixture = path.resolve( __dirname, "fixtures", "imports-field-chained", ); it("should fail to resolve #a when it maps to #b (another import specifier)", (t, done) => { resolver.resolve({}, chainedFixture, "#a", {}, (err, result) => { if (!err) { return done( new Error(`expected error for chained imports, got ${result}`), ); } assert.ok(err instanceof Error); done(); }); }); it("should still resolve #b to ./the.js directly", (t, done) => { resolver.resolve({}, chainedFixture, "#b", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(chainedFixture, "the.js")); done(); }); }); }); // Tests for #/ slash pattern support (node.js PR #60864) // These tests cover the new Node.js behavior that allows #/ patterns // See: https://github.com/nodejs/node/pull/60864 describe("#/ slash pattern (node.js PR #60864)", () => { const slashPatternFixture = path.resolve( __dirname, "fixtures", "imports-slash-pattern", ); it("should resolve #/utils.js using #/* pattern", (t, done) => { resolver.resolve( {}, slashPatternFixture, "#/utils.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(slashPatternFixture, "src/utils.js"), ); done(); }, ); }); it("should resolve #/nested/deep.js using #/* pattern", (t, done) => { resolver.resolve( {}, slashPatternFixture, "#/nested/deep.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(slashPatternFixture, "src/nested/deep.js"), ); done(); }, ); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/incorrect-description-file.test.js000066400000000000000000000035251523262174200266630ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const fixtures = path.join(__dirname, "fixtures", "incorrect-package"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); /** * @param {string[]} args args * @returns {string} paths */ function pp(...args) { return path.join(fixtures, ...args); } describe("incorrect description file", () => { const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: nodeFileSystem, }); it("should not resolve main in incorrect description file #1", (t, done) => { let called = false; const ctx = { fileDependencies: new Set(), log: () => { called = true; }, }; resolver.resolve({}, pp("pack1"), ".", ctx, (err, _result) => { if (!err) return done(new Error("No error")); assert.ok(err instanceof Error); assert.strictEqual( ctx.fileDependencies.has(pp("pack1", "package.json")), true, ); assert.strictEqual(called, true); done(); }); }); it("should not resolve main in incorrect description file #2", (t, done) => { let called = false; const ctx = { fileDependencies: new Set(), log: () => { called = true; }, }; resolver.resolve({}, pp("pack2"), ".", ctx, (err, _result) => { if (!err) return done(new Error("No error")); assert.strictEqual( ctx.fileDependencies.has(pp("pack2", "package.json")), true, ); assert.strictEqual(called, true); done(); }); }); it("should not resolve main in incorrect description file #3", (t, done) => { resolver.resolve({}, pp("pack2"), ".", {}, (err, _result) => { if (!err) return done(new Error("No error")); assert.ok(err instanceof Error); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/log-info.test.js000066400000000000000000000063711523262174200231510ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const LogInfoPlugin = require("../lib/LogInfoPlugin"); const { describe, it } = require("./_runner"); const fixtures = path.join(__dirname, "fixtures"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); describe("LogInfoPlugin", () => { it("logs resolution steps when a log function is provided", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], plugins: [new LogInfoPlugin("resolve")], }); const log = []; resolver.resolve( {}, fixtures, "./a.js", { log: (m) => log.push(m) }, (err) => { if (err) return done(err); assert.ok(log.length > 0); assert.strictEqual( log.some((l) => l.includes("[resolve]")), true, ); done(); }, ); }); it("logs query and fragment when present in the request", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], plugins: [new LogInfoPlugin("normal-resolve")], }); const log = []; resolver.resolve( {}, fixtures, "./a.js?query#frag", { log: (m) => log.push(m) }, (err) => { if (err) return done(err); assert.strictEqual( log.some((l) => l.includes("Resolving request query: ?query")), true, ); assert.strictEqual( log.some((l) => l.includes("Resolving request fragment: #frag")), true, ); done(); }, ); }); it("logs a module request marker when resolving a module request", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, plugins: [new LogInfoPlugin("normal-resolve")], }); const log = []; resolver.resolve( {}, fixtures, "m1/a", { log: (m) => log.push(m) }, (err) => { if (err) return done(err); assert.strictEqual( log.some((l) => l.includes("Request is an module request.")), true, ); assert.strictEqual( log.some((l) => l.includes("Has description data from")), true, ); assert.strictEqual( log.some((l) => l.includes("Relative path from description file is:"), ), true, ); done(); }, ); }); it("logs a directory marker when resolving a directory request", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, plugins: [new LogInfoPlugin("normal-resolve")], }); const log = []; resolver.resolve( {}, fixtures, "./main-field-self/", { log: (m) => log.push(m) }, (err) => { if (err) return done(err); assert.strictEqual( log.some((l) => l.includes("Request is a directory request.")), true, ); done(); }, ); }); it("does not log when no log function is provided", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], plugins: [new LogInfoPlugin("resolve")], }); // This resolve should succeed without errors even though no log is provided. resolver.resolve({}, fixtures, "./a.js", {}, (err, result) => { if (err) return done(err); assert.ok(result); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/main-fields.test.js000066400000000000000000000026671523262174200236330ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); describe("mainFields normalization", () => { it("normalizes a bare string entry", () => { const r = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, mainFields: ["main"], }); assert.deepStrictEqual(r.options.mainFields, [ { name: ["main"], forceRelative: true }, ]); }); it("normalizes an array entry", () => { const r = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, mainFields: [["browser", "main"]], }); assert.deepStrictEqual(r.options.mainFields, [ { name: ["browser", "main"], forceRelative: true }, ]); }); it("preserves forceRelative on object entries with a string name", () => { const r = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, mainFields: [{ name: "main", forceRelative: false }], }); assert.deepStrictEqual(r.options.mainFields, [ { name: ["main"], forceRelative: false }, ]); }); it("preserves object entries with an array name", () => { const r = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, mainFields: [{ name: ["a", "b"], forceRelative: true }], }); assert.deepStrictEqual(r.options.mainFields, [ { name: ["a", "b"], forceRelative: true }, ]); }); }); webpack-enhanced-resolve-7dfc9bc/test/missing.test.js000066400000000000000000000056561523262174200231150ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const path = require("path"); const resolve = require("../"); const { describe, it } = require("./_runner"); describe("missing", () => { /** * @type {[string, string, string[]][]} */ const testCases = [ [ path.join(__dirname, "fixtures"), "./missing-file", [ path.join(__dirname, "fixtures", "missing-file"), path.join(__dirname, "fixtures", "missing-file.js"), path.join(__dirname, "fixtures", "missing-file.node"), ], ], [ path.join(__dirname, "fixtures"), "missing-module", [ path.join(__dirname, "fixtures", "node_modules", "missing-module"), path.join(__dirname, "..", "node_modules", "missing-module"), ], ], [ path.join(__dirname, "fixtures"), "missing-module/missing-file", [ path.join(__dirname, "fixtures", "node_modules", "missing-module"), path.join(__dirname, "..", "node_modules", "missing-module"), ], ], [ path.join(__dirname, "fixtures"), "m1/missing-file", [ path.join(__dirname, "fixtures", "node_modules", "m1", "missing-file"), path.join( __dirname, "fixtures", "node_modules", "m1", "missing-file.js", ), path.join( __dirname, "fixtures", "node_modules", "m1", "missing-file.node", ), path.join(__dirname, "..", "node_modules", "m1"), ], ], [ path.join(__dirname, "fixtures"), "m1/", [ path.join(__dirname, "fixtures", "node_modules", "m1", "index"), path.join(__dirname, "fixtures", "node_modules", "m1", "index.js"), path.join(__dirname, "fixtures", "node_modules", "m1", "index.json"), path.join(__dirname, "fixtures", "node_modules", "m1", "index.node"), ], ], [ path.join(__dirname, "fixtures"), "m1/a", [path.join(__dirname, "fixtures", "node_modules", "m1", "a")], ], ]; for (const testCase of testCases) { it(`should tell about missing file when trying to resolve ${testCase[1]}`, (t, done) => { const missingDependencies = new Set(); /** * @param {Error | null} _err err * @param {string} _filename _filename */ function callback(_err, _filename) { const actual = [...missingDependencies].sort(); for (const dep of testCase[2]) { assert.ok(actual.includes(dep)); } done(); } resolve(testCase[0], testCase[1], { missingDependencies }, callback); }); it(`should report error details exactly once when trying to resolve ${testCase[1]}`, (t, done) => { /** * @param {Error & { details: string } | null} err err * @param {string} _filename _filename */ function callback(err, _filename) { if (err) { const details = err.details.split("\n"); const firstDetail = details.shift(); assert.ok(firstDetail !== undefined); assert.ok(firstDetail.includes(testCase[1])); assert.ok(!details.includes(firstDetail)); } done(); } resolve(testCase[0], testCase[1], callback); }); } }); webpack-enhanced-resolve-7dfc9bc/test/path-browser.test.js000066400000000000000000000104221523262174200240440ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const nodePath = require("path"); const pathBrowser = require("../lib/util/path-browser"); const { describe, it } = require("./_runner"); // The browser shim must behave exactly like Node's `path` for the subset the // resolver relies on. Parity is asserted directly against Node's real module. describe("path-browser shim", () => { const posixCases = [ "", ".", "..", "/", "//", "///", "/foo/bar", "/foo/bar/", "foo/bar", "foo/./bar", "foo/../bar", "foo/bar/..", "../../foo", "/foo/../../bar", "/a//b////c/d/../e", "./foo/bar/", "foo/bar/baz.js", "a/b/c/../../../../d", "/..", "/../..", "./", "../", "...", "/...//", ".hidden/file", "a/b/./././c", "/a/b/c/../../..", "/a/b/c/../../../..", "node_modules/pkg/index.js", ]; const win32Cases = [ "", ".", "\\", "\\\\", "C:\\foo\\bar", "C:\\foo\\..\\bar", "C:/foo/bar", "c:\\a\\b\\..\\c", "\\foo\\bar", "\\\\server\\share\\file", "\\\\server\\share\\dir\\..\\file", "\\\\server\\share", "\\\\server\\share\\", "C:foo\\bar", "C:", "C:.", "C:..\\foo", "C:\\foo\\bar\\", "foo\\bar\\..\\baz", "foo/bar\\baz", "C:\\a\\b\\..\\..\\..\\c", "\\\\server\\share\\a\\..\\..\\b", "C:\\\\\\foo", "\\\\?\\C:\\foo", "\\\\?\\C:\\foo\\bar", ]; // DOS device paths and the CVE-2024-36139 colon-segment guard are Node 22+ // behaviors, so they're pinned to literal expected values (computed from // Node 22) rather than compared to the runtime's `path`, which may be older // (e.g. bun lacks the `.\\` colon guard). const win32Pinned = [ ["\\\\.\\", "\\"], ["\\\\?\\", "\\?\\"], ["\\\\.\\pipe\\a\\..\\b", "\\\\.\\pipe\\b"], ["\\\\?\\C:\\foo\\..\\bar", "\\\\?\\C:\\bar"], ["\\\\?\\C:\\foo\\", "\\\\?\\C:\\foo\\"], [ "\\\\?\\UNC\\server\\share\\dir\\..\\file", "\\\\?\\UNC\\server\\share\\file", ], ["a/C:", ".\\a\\C:"], ["../C:", ".\\..\\C:"], ["foo\\bar:baz", "foo\\bar:baz"], ]; describe("posix.normalize", () => { for (const input of posixCases) { it(`matches Node for ${JSON.stringify(input)}`, () => { assert.strictEqual( pathBrowser.posix.normalize(input), nodePath.posix.normalize(input), ); }); } }); describe("win32.normalize", () => { for (const input of win32Cases) { it(`matches Node for ${JSON.stringify(input)}`, () => { assert.strictEqual( pathBrowser.win32.normalize(input), nodePath.win32.normalize(input), ); }); } }); describe("win32.normalize device paths and colon guard (pinned to Node 22)", () => { for (const [input, expected] of win32Pinned) { it(`normalizes ${JSON.stringify(input)}`, () => { assert.strictEqual(pathBrowser.win32.normalize(input), expected); }); } }); describe("posix.dirname", () => { for (const input of posixCases) { it(`matches Node for ${JSON.stringify(input)}`, () => { assert.strictEqual( pathBrowser.posix.dirname(input), nodePath.posix.dirname(input), ); }); } }); describe("win32.dirname", () => { for (const input of win32Cases) { it(`matches Node for ${JSON.stringify(input)}`, () => { assert.strictEqual( pathBrowser.win32.dirname(input), nodePath.win32.dirname(input), ); }); } }); describe("basename", () => { /** @type {[string, string?][]} */ const cases = [ ["/foo/bar/baz.js"], ["/foo/bar/baz.js", ".js"], ["/foo/bar/"], ["foo.js", ".js"], ["foo.js", ".ts"], ["/"], [""], ["index"], ["a/b/c.test.js", ".js"], ]; for (const [input, suffix] of cases) { it(`matches Node for ${JSON.stringify(input)} / ${JSON.stringify(suffix)}`, () => { assert.strictEqual( pathBrowser.basename(input, suffix), nodePath.posix.basename(input, suffix), ); }); } }); // Documented limitation: reserved Windows device names (CON, COM1, …) are not // special-cased, so `\\.\COM1:` differs from Node (which rewrites it to // `\\?\COM1:\`). Browser-impossible and never routed here. Pinned to the // shim's own output so any unintended change is caught. describe("win32.normalize reserved device name (documented divergence)", () => { it("does not special-case \\\\.\\COM1:", () => { assert.strictEqual( pathBrowser.win32.normalize("\\\\.\\COM1:"), "\\\\.\\COM1:", ); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/path.test.js000066400000000000000000000600461523262174200223720ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const nodePath = require("path"); const { PathType, createCachedBasename, createCachedDirname, createCachedJoin, deprecatedInvalidSegmentRegEx, dirname, getType, invalidSegmentRegEx, isInside, isRelativeRequest, isSubPath, isWindowsPath, join, normalize, } = require("../lib/util/path"); const { describe, it } = require("./_runner"); describe("util/path getType", () => { it("returns Empty for the empty string", () => { assert.strictEqual(getType(""), PathType.Empty); }); it("classifies single-character inputs", () => { assert.strictEqual(getType("."), PathType.Relative); assert.strictEqual(getType("/"), PathType.AbsolutePosix); assert.strictEqual(getType("#"), PathType.Internal); assert.strictEqual(getType("a"), PathType.Normal); }); it("classifies two-character inputs", () => { assert.strictEqual(getType(".."), PathType.Relative); assert.strictEqual(getType("./"), PathType.Relative); assert.strictEqual(getType(".x"), PathType.Normal); assert.strictEqual(getType("/a"), PathType.AbsolutePosix); assert.strictEqual(getType("#a"), PathType.Internal); assert.strictEqual(getType("C:"), PathType.AbsoluteWin); assert.strictEqual(getType("c:"), PathType.AbsoluteWin); assert.strictEqual(getType("ab"), PathType.Normal); assert.strictEqual(getType("1:"), PathType.Normal); }); it("classifies longer inputs", () => { assert.strictEqual(getType("./a"), PathType.Relative); assert.strictEqual(getType("../a"), PathType.Relative); assert.strictEqual(getType(".a"), PathType.Normal); assert.strictEqual(getType("..a"), PathType.Normal); assert.strictEqual(getType(".a/"), PathType.Normal); assert.strictEqual(getType("/abc"), PathType.AbsolutePosix); assert.strictEqual(getType("#foo"), PathType.Internal); assert.strictEqual(getType("C:\\foo"), PathType.AbsoluteWin); assert.strictEqual(getType("c:/foo"), PathType.AbsoluteWin); assert.strictEqual(getType("foo"), PathType.Normal); assert.strictEqual(getType("9:/foo"), PathType.Normal); assert.strictEqual(getType("C:foo"), PathType.Normal); }); it("classifies DOS device paths as Windows-absolute", () => { // Win32 file namespace (\\?\) assert.strictEqual(getType("\\\\?\\C:\\foo"), PathType.AbsoluteWin); assert.strictEqual(getType("\\\\?\\C:\\foo\\bar"), PathType.AbsoluteWin); assert.strictEqual( getType("\\\\?\\UNC\\server\\share"), PathType.AbsoluteWin, ); assert.strictEqual(getType("\\\\?\\Volume{abc}\\f"), PathType.AbsoluteWin); // Win32 device namespace (\\.\) assert.strictEqual(getType("\\\\.\\C:\\foo"), PathType.AbsoluteWin); assert.strictEqual(getType("\\\\.\\PhysicalDrive0"), PathType.AbsoluteWin); // Bare prefix still counts — the filesystem will reject it, but // classifying it as Windows-absolute keeps downstream calls on // `path.win32` instead of silently falling back to posix. assert.strictEqual(getType("\\\\?\\"), PathType.AbsoluteWin); assert.strictEqual(getType("\\\\.\\"), PathType.AbsoluteWin); }); it("classifies UNC paths as Windows-absolute", () => { // `path.win32` roots every path starting with two backslashes, so a // share belongs on win32 just like a DOS device path does. assert.strictEqual(getType("\\\\server\\share"), PathType.AbsoluteWin); assert.strictEqual(getType("\\\\server\\share\\a"), PathType.AbsoluteWin); // Too short to name a share, still rooted. assert.strictEqual(getType("\\\\"), PathType.AbsoluteWin); assert.strictEqual(getType("\\\\?"), PathType.AbsoluteWin); assert.strictEqual(getType("\\\\."), PathType.AbsoluteWin); }); it("does not classify other backslash paths as Windows-absolute", () => { // A single leading backslash is a rooted path only on Windows, and a // filename character everywhere else — too ambiguous to reroute. assert.strictEqual(getType("\\?\\C:\\foo"), PathType.Normal); assert.strictEqual(getType("\\a\\b"), PathType.Normal); // A leading forward slash is a posix root, however the separator after // it is spelled — `path.win32` would read both as a UNC root. assert.strictEqual(getType("//?/C:/foo"), PathType.AbsolutePosix); assert.strictEqual(getType("//server/share"), PathType.AbsolutePosix); assert.strictEqual(getType("/\\server\\share"), PathType.AbsolutePosix); }); }); describe("util/path normalize", () => { it("returns the input when empty", () => { assert.strictEqual(normalize(""), ""); }); it("normalizes Windows absolute paths", () => { assert.strictEqual(normalize("C:\\foo\\..\\bar"), "C:\\bar"); }); it("keeps relative paths relative", () => { assert.strictEqual(normalize("./a/b"), "./a/b"); assert.strictEqual(normalize("./a/../b"), "./b"); }); it("normalizes posix absolute paths", () => { assert.strictEqual(normalize("/a/b/../c"), "/a/c"); }); it("normalizes normal paths through posix normalize", () => { assert.strictEqual(normalize("a/b/../c"), "a/c"); }); it("normalizes UNC paths via win32", () => { assert.strictEqual( normalize("\\\\server\\share\\a\\..\\b"), "\\\\server\\share\\b", ); assert.strictEqual( normalize("\\\\server\\share\\\\a"), "\\\\server\\share\\a", ); }); it("normalizes DOS device paths via win32", () => { assert.strictEqual(normalize("\\\\?\\C:\\foo\\..\\bar"), "\\\\?\\C:\\bar"); assert.strictEqual(normalize("\\\\.\\C:\\foo\\..\\bar"), "\\\\.\\C:\\bar"); assert.strictEqual( normalize("\\\\?\\UNC\\server\\share\\a\\..\\b"), "\\\\?\\UNC\\server\\share\\b", ); }); }); describe("util/path join", () => { it("returns normalized rootPath when no request is given", () => { assert.strictEqual(join("/a/b", ""), "/a/b"); assert.strictEqual(join("/a/b", undefined), "/a/b"); }); it("uses an absolute posix request as-is", () => { assert.strictEqual(join("/a/b", "/c/d"), "/c/d"); }); it("uses an absolute windows request as-is", () => { assert.strictEqual(join("/a/b", "C:\\c\\d"), "C:\\c\\d"); }); it("joins rooted posix-style paths", () => { assert.strictEqual(join("/a/b", "./c"), "/a/b/c"); assert.strictEqual(join("a/b", "c"), "a/b/c"); assert.strictEqual(join("./a", "b"), "a/b"); }); it("joins rooted windows-style paths", () => { assert.strictEqual(join("C:\\a", "b"), "C:\\a\\b"); }); it("joins UNC paths with win32 semantics", () => { assert.strictEqual( join("\\\\server\\share\\a", "b"), "\\\\server\\share\\a\\b", ); // Absolute UNC request wins over any root. assert.strictEqual( join("/posix/root", "\\\\server\\share\\a"), "\\\\server\\share\\a", ); }); it("joins DOS device paths with win32 semantics", () => { assert.strictEqual(join("\\\\?\\C:\\a", "b"), "\\\\?\\C:\\a\\b"); assert.strictEqual(join("\\\\.\\C:\\a", "b"), "\\\\.\\C:\\a\\b"); // Absolute DOS device request wins over any root. assert.strictEqual(join("/posix/root", "\\\\?\\C:\\c"), "\\\\?\\C:\\c"); }); }); describe("util/path dirname", () => { it("computes posix dirname for posix paths", () => { assert.strictEqual(dirname("/a/b/c"), "/a/b"); assert.strictEqual(dirname("a/b"), "a"); }); it("computes windows dirname for windows absolute paths", () => { assert.strictEqual(dirname("C:\\foo\\bar"), "C:\\foo"); }); it("computes windows dirname for UNC paths", () => { assert.strictEqual( dirname("\\\\server\\share\\a\\b"), "\\\\server\\share\\a", ); // The share itself is the root, so walking up stops there. assert.strictEqual(dirname("\\\\server\\share\\a"), "\\\\server\\share\\"); }); it("computes windows dirname for DOS device paths", () => { assert.strictEqual(dirname("\\\\?\\C:\\foo\\bar"), "\\\\?\\C:\\foo"); assert.strictEqual(dirname("\\\\.\\C:\\foo\\bar"), "\\\\.\\C:\\foo"); assert.strictEqual( dirname("\\\\?\\UNC\\server\\share\\a\\b"), "\\\\?\\UNC\\server\\share\\a", ); }); }); describe("util/path cachedJoin", () => { it("returns the same value on cache hit", () => { const cachedJoin = createCachedJoin().fn; const a = cachedJoin("/root", "a/b"); const b = cachedJoin("/root", "a/b"); assert.strictEqual(a, b); assert.strictEqual(a, "/root/a/b"); }); it("keeps separate caches per root", () => { const cachedJoin = createCachedJoin().fn; const a = cachedJoin("/x", "req"); const b = cachedJoin("/y", "req"); const a2 = cachedJoin("/x", "req"); assert.strictEqual(a, a2); assert.notStrictEqual(a, b); }); }); describe("util/path cachedDirname", () => { it("returns the same value on cache hit", () => { const cachedDirname = createCachedDirname().fn; const a = cachedDirname("/cached/a/b"); const b = cachedDirname("/cached/a/b"); assert.strictEqual(a, b); assert.strictEqual(a, "/cached/a"); }); }); describe("util/path cachedBasename", () => { it("returns the same value on cache hit", () => { const cachedBasename = createCachedBasename().fn; const a = cachedBasename("/cached/a/b"); const b = cachedBasename("/cached/a/b"); assert.strictEqual(a, b); assert.strictEqual(a, "b"); }); it("returns the same value on cache hit with suffix", () => { const cachedBasename = createCachedBasename().fn; const a = cachedBasename("/cached/a/b.ext", ".ext"); const b = cachedBasename("/cached/a/b.ext", ".ext"); assert.strictEqual(a, b); assert.strictEqual(a, "b"); }); it("keeps separate caches per root", () => { const cachedBasename = createCachedBasename().fn; const a = cachedBasename("/x"); const b = cachedBasename("/y"); const a2 = cachedBasename("/x"); assert.strictEqual(a, a2); assert.notStrictEqual(a, b); }); it("keeps separate caches per root with suffix", () => { const cachedBasename = createCachedBasename().fn; const a = cachedBasename("/x.ext", ".ext"); const b = cachedBasename("/y.ext", ".ext"); const a2 = cachedBasename("/x.ext", ".ext"); assert.strictEqual(a, a2); assert.notStrictEqual(a, b); }); }); describe("util/path isRelativeRequest", () => { // Must match the legacy /^\.\.?(?:\/|$)/ regex exactly, since the helper // replaced it in several hot paths. Verify each branch individually. it("returns true for exactly '.'", () => { assert.strictEqual(isRelativeRequest("."), true); }); it("returns true for exactly '..'", () => { assert.strictEqual(isRelativeRequest(".."), true); }); it("returns true for './' and './foo/bar'", () => { assert.strictEqual(isRelativeRequest("./"), true); assert.strictEqual(isRelativeRequest("./foo"), true); assert.strictEqual(isRelativeRequest("./foo/bar"), true); }); it("returns true for '../' and '../foo'", () => { assert.strictEqual(isRelativeRequest("../"), true); assert.strictEqual(isRelativeRequest("../foo"), true); }); it("returns false for bare specifiers and absolute paths", () => { assert.strictEqual(isRelativeRequest(""), false); assert.strictEqual(isRelativeRequest("foo"), false); assert.strictEqual(isRelativeRequest("/abs"), false); assert.strictEqual(isRelativeRequest("#imports"), false); assert.strictEqual(isRelativeRequest("C:\\win"), false); }); it("returns false for dotted names that are not relative requests", () => { // ".foo" is a normal specifier (hidden-file-style), not a relative request. assert.strictEqual(isRelativeRequest(".foo"), false); // "..foo" likewise — only "..", "../..." are relative. assert.strictEqual(isRelativeRequest("..foo"), false); }); }); describe("util/path isSubPath", () => { it("returns true for a child under parent", () => { assert.strictEqual(isSubPath("/a/b", "/a/b/c"), true); }); it("returns false for a sibling that starts with the parent name", () => { assert.strictEqual(isSubPath("/app", "/app-other/file"), false); }); it("handles parents that already end with a slash", () => { assert.strictEqual(isSubPath("/a/b/", "/a/b/c"), true); }); it("handles parents that already end with a backslash", () => { assert.strictEqual(isSubPath("C:\\a\\b\\", "C:\\a\\b\\c"), true); }); it("handles Windows-style children when the parent is not separator-terminated", () => { assert.strictEqual(isSubPath("C:\\a", "C:\\a\\b"), true); }); it("returns false when child and parent are equal (without trailing separator)", () => { // A path is not a subpath of itself — there has to be a separator // after the parent prefix. assert.strictEqual(isSubPath("/a/b", "/a/b"), false); }); it("returns true when child equals a parent that already ends with a separator", () => { // `/a/b/` IS considered a "prefix" of `/a/b/` — startsWith is true // and the old implementation agreed. Lock it in so later refactors // don't silently regress. assert.strictEqual(isSubPath("/a/b/", "/a/b/"), true); }); it("returns false when parent is longer than child", () => { assert.strictEqual(isSubPath("/a/b/c", "/a/b"), false); }); it("returns true for an empty parent only when the child starts with a separator", () => { // Matches the old `normalize("" + "/") === "/"` fallback semantics. assert.strictEqual(isSubPath("", "/a/b"), true); assert.strictEqual(isSubPath("", "C:\\a"), false); assert.strictEqual(isSubPath("", "foo"), false); assert.strictEqual(isSubPath("", ""), false); }); it("compares a Windows parent the way windows does", () => { assert.strictEqual(isSubPath("C:\\a\\b", "C:/a/b/c"), true); assert.strictEqual(isSubPath("C:/a/b", "C:\\a\\b/c"), true); assert.strictEqual(isSubPath("C:\\a\\b", "c:\\A\\B\\c"), true); assert.strictEqual(isSubPath("C:\\a\\b", "C:\\a\\b-other"), false); }); it("keeps a backslash a filename character in a posix parent", () => { assert.strictEqual(isSubPath("/a/b", "/a/b\\c"), false); assert.strictEqual(isSubPath("/a/b\\c", "/a/b\\c\\d"), false); assert.strictEqual(isSubPath("/a/b", "/A/b/c"), false); }); }); describe("util/path isWindowsPath", () => { it("detects a path rooted at a drive letter", () => { assert.strictEqual(isWindowsPath("C:\\a"), true); assert.strictEqual(isWindowsPath("C:/a"), true); assert.strictEqual(isWindowsPath("c:a"), true); assert.strictEqual(isWindowsPath("C:"), true); }); it("detects a path rooted at a backslash", () => { assert.strictEqual(isWindowsPath("\\a\\b"), true); assert.strictEqual(isWindowsPath("\\\\server\\share"), true); assert.strictEqual(isWindowsPath("\\\\?\\C:\\a"), true); }); it("treats everything else as posix", () => { assert.strictEqual(isWindowsPath("/a/b"), false); assert.strictEqual(isWindowsPath("/a/b\\c"), false); assert.strictEqual(isWindowsPath("a\\b"), false); assert.strictEqual(isWindowsPath("1:\\a"), false); assert.strictEqual(isWindowsPath(""), false); }); it("treats a path starting with // as posix", () => { // `path.win32` reads it as a UNC root, but here it cannot be told apart // from a posix path, where `\` has to stay a filename character. assert.strictEqual(isWindowsPath("//server/share"), false); }); }); describe("util/path isInside", () => { it("returns true for the parent itself", () => { assert.strictEqual(isInside("/a/b", "/a/b"), true); assert.strictEqual(isInside("/a/b/", "/a/b"), true); assert.strictEqual(isInside("C:\\a\\", "C:\\a"), true); }); it("ignores trailing separators on the parent", () => { assert.strictEqual(isInside("/a/b/", "/a/b/c"), true); assert.strictEqual(isInside("/", "/a"), true); assert.strictEqual(isInside("C:\\a\\b\\", "C:\\a\\b\\c"), true); }); it("requires a segment boundary", () => { assert.strictEqual(isInside("/a/b", "/a/b-other"), false); assert.strictEqual(isInside("/a/b", "/a"), false); assert.strictEqual(isInside("C:\\a\\b", "C:\\a\\b-other"), false); }); it("compares a Windows parent the way windows does", () => { assert.strictEqual(isInside("C:\\a\\b", "C:/a/b/c"), true); assert.strictEqual(isInside("C:/a/b", "C:\\a\\b/c"), true); assert.strictEqual(isInside("C:\\a\\b", "c:\\A\\B\\c"), true); assert.strictEqual( isInside("\\\\server\\share\\a", "\\\\SERVER\\share\\a\\b"), true, ); assert.strictEqual( isInside("\\\\server\\share\\a", "\\\\server\\other\\a\\b"), false, ); }); it("keeps a backslash a filename character in a posix parent", () => { assert.strictEqual(isInside("/a/b", "/a/b\\c"), false); assert.strictEqual(isInside("/a/b\\c", "/a/b\\c\\d"), false); assert.strictEqual(isInside("/a/b", "/A/B/c"), false); }); }); describe("util/path exported regexes", () => { it("deprecatedInvalidSegmentRegEx matches .. segments", () => { assert.strictEqual(deprecatedInvalidSegmentRegEx.test("/foo/../bar"), true); }); it("invalidSegmentRegEx matches node_modules segments", () => { assert.strictEqual(invalidSegmentRegEx.test("/foo/node_modules/bar"), true); assert.strictEqual(invalidSegmentRegEx.test("/foo/../bar"), true); }); }); describe("util/path join fallbacks for special rootPath types", () => { it("falls back when rootPath is Empty and request is Relative", () => { // rootPath empty → falls into the last switch. Relative request returns // posixNormalize("") === "." which is itself relative, returned as-is. assert.strictEqual(join("", "./foo"), "."); }); it("falls back when rootPath is Empty and request is a Normal name", () => { // Normal request: falls through to posixNormalize(rootPath) === "." assert.strictEqual(join("", "foo"), "."); }); it("falls back when rootPath is Internal (#...) and request is Normal", () => { // rootPath "#x" (Internal) and request "foo" (Normal): falls through to // posixNormalize(rootPath). assert.strictEqual(join("#x", "foo"), "#x"); }); it("falls back when rootPath is Internal (#...) and request is Relative", () => { // rootPath "#x" (Internal) and request "./foo" (Relative): returns // posixNormalize(rootPath) ("#x"), not relative, so prefixed with "./". assert.strictEqual(join("#x", "./foo"), "./#x"); }); }); // Node's own `path` is the reference for how a path behaves. These tests keep // `lib/util/path.js` answering the way `path.win32` and `path.posix` do, and // spell out every shape where it deliberately answers differently. describe("util/path alignment with node's path module", () => { // Which flavor node reads a path as: the two parsers disagree about the // root exactly when the path is Windows-specific. const nodeReadsAsWindows = (maybePath) => nodePath.win32.parse(maybePath).root !== nodePath.posix.parse(maybePath).root; const nodeFlavor = (maybePath) => nodeReadsAsWindows(maybePath) ? nodePath.win32 : nodePath.posix; // The shapes we answer differently on purpose, each asserted on its own in // "documented divergences" below. const isDocumentedDivergence = (maybePath) => { // a leading forward slash is a posix root however the next separator is // spelled, while `path.win32` reads two separators as a UNC root if (maybePath.startsWith("//") || maybePath.startsWith("/\\")) return true; // a single leading backslash roots a path only on windows if (maybePath.startsWith("\\") && !maybePath.startsWith("\\\\")) { return true; } // drive-relative (`C:foo`), which node roots but does not call absolute if (/^[a-zA-Z]:[^\\/]/.test(maybePath)) return true; // requests the resolver handles with its own semantics const type = getType(maybePath); return ( type === PathType.Relative || type === PathType.Empty || type === PathType.Internal ); }; const requests = ["b", "./b", "../b", "b/c"]; const assertMatchesNode = (maybePath) => { const flavor = nodeFlavor(maybePath); const subject = JSON.stringify(maybePath); assert.strictEqual( getType(maybePath) === PathType.AbsoluteWin, nodeReadsAsWindows(maybePath), `flavor of ${subject}`, ); assert.strictEqual( normalize(maybePath), flavor.normalize(maybePath), `normalize(${subject})`, ); assert.strictEqual( dirname(maybePath), flavor.dirname(maybePath), `dirname(${subject})`, ); for (const request of requests) { assert.strictEqual( join(maybePath, request), flavor.join(maybePath, request), `join(${subject}, ${JSON.stringify(request)})`, ); } }; const paths = [ // posix "/", "/a", "/a/b/c", "/a/b/c/", "/a//b", "/a/./b", "/a/../b", "/a/b\\c", "/a/b c/d", // windows drive "C:", "c:", "C:\\", "C:\\a", "C:\\a\\b", "C:/a/b", "C:\\a/b", "C:\\a\\..\\b", "C:\\a\\.\\b", "C:\\a\\\\b", "C:\\a\\b\\", "c:\\a", // UNC "\\\\server\\share", "\\\\server\\share\\", "\\\\server\\share\\a", "\\\\server\\share\\a\\b", "\\\\server\\share\\a\\..\\b", "\\\\server\\share\\a\\.\\b", "\\\\server\\share\\\\a", "\\\\server\\share\\a/b", "\\\\SERVER\\Share\\a", // DOS device "\\\\?\\C:\\a", "\\\\?\\C:\\a\\..\\b", "\\\\?\\UNC\\server\\share\\a", "\\\\.\\C:\\a", "\\\\.\\PhysicalDrive0", "\\\\?\\Volume{abc}\\f", "\\\\?\\", "\\\\", "\\\\?", "\\\\.", "\\\\a", // module requests "lodash", "@scope/pkg", "a", ]; for (const maybePath of paths) { it(`answers like node for ${JSON.stringify(maybePath)}`, () => { // a path listed here must not be one we diverge on assert.strictEqual( isDocumentedDivergence(maybePath), false, `${JSON.stringify(maybePath)} is a documented divergence`, ); assertMatchesNode(maybePath); }); } it("answers like node for generated path shapes", () => { // Seeded so a failure reproduces, and wide enough to reach shapes // nobody enumerated by hand. let seed = 42; const random = (max) => { seed = (seed + 0x6d2b79f5) | 0; let t = seed; t = Math.imul(t ^ (t >>> 15), t | 1); t ^= t + Math.imul(t ^ (t >>> 7), t | 61); return ((((t ^ (t >>> 14)) >>> 0) / 4294967296) * max) | 0; }; const prefixes = [ "", "/", "//", "\\", "\\\\", "C:\\", "C:/", "c:", "\\\\server\\share\\", "\\\\server\\share", "\\\\?\\C:\\", "\\\\.\\C:\\", "\\\\?\\UNC\\server\\share\\", "./", "../", "#", ]; const segments = [ "a", "b", "..", ".", "sub dir", "x.js", "", "node_modules", ]; const separators = ["/", "\\"]; const makePath = () => { let result = prefixes[random(prefixes.length)]; const count = random(5); for (let i = 0; i < count; i++) { if (i > 0) result += separators[random(separators.length)]; result += segments[random(segments.length)]; } if (random(4) === 0) result += separators[random(separators.length)]; return result; }; let compared = 0; for (let i = 0; i < 5000; i++) { const maybePath = makePath(); if (isDocumentedDivergence(maybePath)) continue; assertMatchesNode(maybePath); compared++; } // guards against a generator change quietly emptying this assert.ok(compared > 1000, `only ${compared} shapes compared`); }); describe("documented divergences", () => { it("reads a leading forward slash as a posix root", () => { for (const maybePath of [ "//server/share", "/\\server\\share", "//?/C:/foo", ]) { assert.strictEqual(getType(maybePath), PathType.AbsolutePosix); // node takes any two leading separators for a UNC root assert.strictEqual(nodeReadsAsWindows(maybePath), true); } }); it("keeps a single leading backslash a filename character", () => { // rooted on windows, an ordinary character everywhere else, and // nothing in the string tells the two apart for (const maybePath of ["\\a\\b", "\\", "\\?\\C:\\foo"]) { assert.notStrictEqual(getType(maybePath), PathType.AbsoluteWin); assert.strictEqual(nodeReadsAsWindows(maybePath), true); } }); it("keeps a drive-relative path normal", () => { // node roots `C:foo` at `C:` but does not call it absolute, and // `PathType` has no windows-relative member — classifying it as // `AbsoluteWin` would make `join` drop the root it is relative to assert.strictEqual(getType("C:foo"), PathType.Normal); assert.strictEqual(nodePath.win32.parse("C:foo").root, "C:"); assert.strictEqual(nodePath.win32.isAbsolute("C:foo"), false); }); it("keeps the ./ prefix of a relative request", () => { assert.strictEqual(normalize("./a/b"), "./a/b"); assert.strictEqual(nodePath.posix.normalize("./a/b"), "a/b"); }); it("keeps an empty path empty", () => { assert.strictEqual(normalize(""), ""); assert.strictEqual(nodePath.posix.normalize(""), "."); }); it("keeps an internal request out of path handling", () => { assert.strictEqual(getType("#a/b"), PathType.Internal); assert.strictEqual(join("#x", "foo"), "#x"); assert.strictEqual(nodePath.posix.join("#x", "foo"), "#x/foo"); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/plugins.test.js000066400000000000000000000041611523262174200231130ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, CloneBasenamePlugin, ResolverFactory, } = require("../"); const { describe, it } = require("./_runner"); describe("plugins", () => { it("should resolve with the CloneBasenamePlugin", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: require("fs"), plugins: [ new CloneBasenamePlugin( "after-existing-directory", "undescribed-raw-file", ), ], }); resolver.resolve( {}, __dirname, "./fixtures/directory-default", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve( __dirname, "fixtures/directory-default/directory-default.js", ), ); done(); }, ); }); it("should ignore 'false'/'null'/'undefined' plugins", (t, done) => { const FailedPlugin = class { apply() { throw new Error("FailedPlugin"); } }; const falsy = false; const resolver = ResolverFactory.createResolver({ fileSystem: require("fs"), plugins: [ 0, "", false, null, undefined, falsy && new FailedPlugin(), new CloneBasenamePlugin( "after-existing-directory", "undescribed-raw-file", ), ], }); resolver.resolve( {}, __dirname, "./fixtures/directory-default", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve( __dirname, "fixtures/directory-default/directory-default.js", ), ); done(); }, ); }); it("function-style plugins are invoked during createResolver with the resolver instance", () => { const nodeFileSystem = new CachedInputFileSystem(fs, 4000); let seenResolver; const r = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, plugins: [ function fnPlugin(resolver) { seenResolver = resolver; }, ], }); assert.strictEqual(seenResolver, r); }); }); webpack-enhanced-resolve-7dfc9bc/test/pnp.test.js000066400000000000000000000256151523262174200222360ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { after, before, beforeEach, describe, it } = require("./_runner"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const fixture = path.resolve(__dirname, "fixtures", "pnp"); let isAdmin = false; try { fs.symlinkSync("dir", path.resolve(fixture, "pkg/symlink"), "dir"); isAdmin = true; } catch (_err) { // ignore } try { fs.unlinkSync(path.resolve(fixture, "pkg/symlink")); } catch (_err) { isAdmin = false; // ignore } describe("pnp", () => { let pnpApi; let resolverFuzzy; let resolver; if (isAdmin) { before(() => { fs.symlinkSync("dir", path.resolve(fixture, "pkg/symlink"), "dir"); }); } beforeEach(() => { // eslint-disable-next-line jsdoc/reject-any-type pnpApi = /** @type {any} */ ({ mocks: new Map(), ignoredIssuers: new Set(), resolveToUnqualified(request, issuer) { if (pnpApi.ignoredIssuers.has(issuer)) { return null; } else if (pnpApi.mocks.has(request)) { return pnpApi.mocks.get(request); } const err = /** @type {Error & { code: string, pnpCode: string }} */ (new Error("No way")); err.code = "MODULE_NOT_FOUND"; err.pnpCode = "UNDECLARED_DEPENDENCY"; throw err; }, }); resolverFuzzy = ResolverFactory.createResolver({ extensions: [".ts", ".js"], aliasFields: ["browser"], fileSystem: nodeFileSystem, alias: { alias: path.resolve(fixture, "pkg"), }, pnpApi, modules: ["node_modules", path.resolve(fixture, "../pnp-a")], }); resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], fileSystem: nodeFileSystem, fullySpecified: true, alias: { alias: path.resolve(fixture, "pkg"), }, pnpApi, modules: [ "alternative-modules", "node_modules", path.resolve(fixture, "../pnp-a"), ], }); }); if (isAdmin) { after(() => { fs.unlinkSync(path.resolve(fixture, "pkg/symlink")); }); } it("should resolve by going through the pnp api", (t, done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolver.resolve({}, __dirname, "pkg/dir/index.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "pkg/dir/index.js")); done(); }); }); it("should not resolve a not fully specified request when fullySpecified is set", (t, done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolver.resolve({}, __dirname, "pkg/dir/index", {}, (err, _result) => { assert.ok(err instanceof Error); done(); }); }); it("should track dependency to the pnp api", (t, done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); pnpApi.mocks.set("pnpapi", path.resolve(fixture, ".pnp.js")); const fileDependencies = new Set(); resolver.resolve( {}, __dirname, "pkg/dir/index.js", { fileDependencies }, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "pkg/dir/index.js"), ); assert.ok( [...fileDependencies].includes(path.resolve(fixture, ".pnp.js")), ); done(); }, ); }); it("should resolve module names with package.json", (t, done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolver.resolve({}, __dirname, "pkg", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "pkg/main.js")); done(); }); }); it("should resolve namespaced module names", (t, done) => { pnpApi.mocks.set("@user/pkg", path.resolve(fixture, "pkg")); resolver.resolve({}, __dirname, "@user/pkg", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "pkg/main.js")); done(); }); }); it( "should not resolve symlinks", isAdmin ? (t, done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolverFuzzy.resolve( {}, __dirname, "pkg/symlink", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "pkg/symlink/index.js"), ); done(); }, ); } : undefined, ); it("should properly deal with other extensions", (t, done) => { pnpApi.mocks.set("@user/pkg", path.resolve(fixture, "pkg")); resolverFuzzy.resolve( {}, __dirname, "@user/pkg/typescript", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "pkg/typescript/index.ts"), ); done(); }, ); }); it("should properly deal package.json alias", (t, done) => { pnpApi.mocks.set("pkg", path.resolve(fixture, "pkg")); resolverFuzzy.resolve( {}, __dirname, "pkg/package-alias", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "pkg/package-alias/browser.js"), ); done(); }, ); }); it("should prefer pnp resolves over normal modules", (t, done) => { pnpApi.mocks.set("m1", path.resolve(fixture, "../node_modules/m2")); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "m1/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "../node_modules/m2/b.js"), ); done(); }, ); }); it("should prefer alternative module directories over pnp", (t, done) => { pnpApi.mocks.set("m1", path.resolve(fixture, "../node_modules/m2")); resolver.resolve( {}, path.resolve(__dirname, "fixtures/prefer-pnp"), "m1/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve( __dirname, "fixtures/prefer-pnp/alternative-modules/m1/b.js", ), ); done(); }, ); }); it("should prefer alias over pnp resolves", (t, done) => { pnpApi.mocks.set("alias", path.resolve(fixture, "pkg/dir")); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "alias/index.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "pkg/index.js")); done(); }, ); }); it("should prefer pnp over modules after node_modules", (t, done) => { pnpApi.mocks.set("m2", path.resolve(fixture, "pkg")); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "m2/index.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "pkg/index.js")); done(); }, ); }); it("should fallback to alternatives when pnp resolving fails", (t, done) => { resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "m2/a.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "../pnp-a/m2/a.js"), ); done(); }, ); }); it("should fallback to alternatives when pnp doesn't manage the issuer", (t, done) => { pnpApi.ignoredIssuers.add(`${path.resolve(__dirname, "fixtures")}/`); // Add the wrong path on purpose to make sure the issuer is ignored pnpApi.mocks.set("m2", path.resolve(fixture, "pkg")); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "m2/b.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(__dirname, "fixtures/node_modules/m2/b.js"), ); done(); }, ); }); it("should handle the exports field when using PnP", (t, done) => { pnpApi.mocks.set("m1", path.resolve(fixture, "pkg3")); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "m1", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "pkg3/a.js")); done(); }, ); }); it("should handle the exports field when using PnP (with sub path)", (t, done) => { pnpApi.mocks.set("@user/m1", path.resolve(fixture, "pkg3")); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "@user/m1/x", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.resolve(fixture, "pkg3/a.js")); done(); }, ); }); it("falls through when pnpApi throws an UNDECLARED_DEPENDENCY error and logs each line", (t, done) => { const pnpApi = { resolveToUnqualified() { const err = /** @type {Error & { code: string, pnpCode: string }} */ (new Error("line-1\nline-2")); err.code = "MODULE_NOT_FOUND"; err.pnpCode = "UNDECLARED_DEPENDENCY"; throw err; }, }; const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, pnpApi, modules: ["node_modules", path.resolve(fixture, "../pnp-a")], }); const logs = []; resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "m2/a.js", { log: (m) => logs.push(m) }, (err, result) => { if (err) return done(err); assert.deepStrictEqual( result, path.resolve(fixture, "../pnp-a/m2/a.js"), ); assert.strictEqual( logs.some((l) => l.includes("request is not managed by the pnpapi")), true, ); done(); }, ); }); it("propagates unexpected errors from pnpApi", (t, done) => { const pnpApi = { resolveToUnqualified() { throw new Error("unexpected-pnp"); }, }; const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, pnpApi, modules: ["node_modules", path.resolve(fixture, "../pnp-a")], }); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "m2/a.js", {}, (err) => { assert.ok(err); assert.strictEqual( /** @type {Error} */ (err).message, "unexpected-pnp", ); done(); }, ); }); it("returns an error when neither pnp nor the alternate find a result", (t, done) => { const pnpApi = { resolveToUnqualified() { return null; }, }; const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, pnpApi, modules: ["node_modules"], }); resolver.resolve( {}, path.resolve(__dirname, "fixtures"), "no-such-package", {}, (err) => { assert.ok(err instanceof Error); done(); }, ); }); it("attempts the process.versions.pnp auto-detection path", () => { // eslint-disable-next-line jsdoc/reject-any-type const { pnp: originalPnp } = /** @type {any} */ (process.versions); try { Object.defineProperty(process.versions, "pnp", { value: "0.0.0", configurable: true, }); assert.doesNotThrow(() => ResolverFactory.createResolver({ fileSystem: nodeFileSystem }), ); } finally { if (originalPnp === undefined) { // eslint-disable-next-line jsdoc/reject-any-type delete (/** @type {any} */ (process.versions).pnp); } else { Object.defineProperty(process.versions, "pnp", { value: originalPnp, configurable: true, }); } } }); }); webpack-enhanced-resolve-7dfc9bc/test/polyfill-text-encoding.js000066400000000000000000000013301523262174200250470ustar00rootroot00000000000000"use strict"; // TODO: drop this file once `engines.node` is bumped to >= 11. It is a no-op // on every supported runtime today and only exists for the Node.js 10 leg of // the test CI matrix. // Node 10 lacks the global TextEncoder/TextDecoder that browsers, Deno, Bun and // Node >= 11 provide; expose them from `util` so the suite (and the library's // Uint8Array decode path) runs there too. No-op on every supported runtime. if (typeof TextDecoder === "undefined" || typeof TextEncoder === "undefined") { // eslint-disable-next-line n/prefer-global/text-decoder, n/prefer-global/text-encoder const { TextDecoder, TextEncoder } = require("util"); global.TextDecoder = TextDecoder; global.TextEncoder = TextEncoder; } webpack-enhanced-resolve-7dfc9bc/test/pr-53.test.js000066400000000000000000000010561523262174200223000ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { CachedInputFileSystem } = require("../"); const { describe, it } = require("./_runner"); describe("pr-53", () => { it("should allow to readJsonSync in CachedInputFileSystem", () => { const cfs = new CachedInputFileSystem( { // @ts-expect-error for tests readFileSync(path) { return JSON.stringify(`abc${path}`); }, }, 1000, ); if (!cfs.readJsonSync) throw new Error("readJsonSync must be available"); assert.strictEqual(cfs.readJsonSync("xyz"), "abcxyz"); }); }); webpack-enhanced-resolve-7dfc9bc/test/recursion.test.js000066400000000000000000000036161523262174200234470ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const fixtures = path.join(__dirname, "fixtures"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); describe("recursion detection", () => { it("surfaces a recursion error when a plugin re-invokes doResolve on the same hook/request", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], plugins: [ { apply(r) { r.hooks.resolve.tapAsync("ForceRecursion", (req, ctx, cb) => { // Manually re-call doResolve on the same hook to trigger the // recursion guard in doResolve. r.doResolve(r.hooks.resolve, req, "force", ctx, cb); }); }, }, ], }); resolver.resolve({}, fixtures, "./a.js", {}, (err) => { assert.ok(err instanceof Error); // The recursion error may be wrapped; either shape is acceptable. const msg = /** @type {Error} */ (err).message; assert.strictEqual( /Recursion in resolving|Can't resolve/.test(msg), true, ); done(); }); }); it("logs 'abort resolving because of recursion' when a log is provided", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], plugins: [ { apply(r) { r.hooks.resolve.tapAsync("ForceRecursion2", (req, ctx, cb) => { r.doResolve(r.hooks.resolve, req, "force", ctx, cb); }); }, }, ], }); const log = []; resolver.resolve( {}, fixtures, "./a.js", { log: (m) => log.push(m) }, (err) => { assert.ok(err instanceof Error); assert.strictEqual( log.some((l) => l.includes("abort resolving because of recursion")), true, ); done(); }, ); }); }); webpack-enhanced-resolve-7dfc9bc/test/resolve-context-stack.test.js000066400000000000000000000224511523262174200257000ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const fixture = path.resolve(__dirname, "fixtures", "extensions"); describe("resolveContext.stack", () => { const resolver = ResolverFactory.createResolver({ extensions: [".ts", ".js"], fileSystem: nodeFileSystem, }); it("should resolve when no stack is supplied", (t, done) => { resolver.resolve({}, fixture, "./foo", {}, (err, result) => { if (err) return done(err); assert.ok(result); done(); }); }); it("should resolve when an empty StackEntry is supplied as stack", (t, done) => { resolver.resolve( {}, fixture, "./foo", { stack: new Set() }, (err, result) => { if (err) return done(err); assert.ok(result); done(); }, ); }); it("should resolve when a non-empty Set is supplied as stack", (t, done) => { // The values below are arbitrary tokens that must not collide with any // real `resolve` step. Providing them exercises the code path where a // caller pre-seeds the recursion-tracking stack. resolver.resolve( {}, fixture, "./foo", { stack: new Set(["custom-entry-1", "custom-entry-2"]) }, (err, result) => { if (err) return done(err); assert.ok(result); done(); }, ); }); it("should detect recursion against entries pre-seeded in the stack", (t, done) => { // The first stack entry that `resolve` pushes for this request is // `resolve: (…fixture…) ./foo`. Pre-seeding an identical string in // the context must trigger the recursion guard and abort the resolve. const preSeededEntry = `resolve: (${fixture}) ./foo`; resolver.resolve( {}, fixture, "./foo", { stack: new Set([preSeededEntry]) }, (err) => { assert.ok(err); assert.strictEqual( /** @type {Error & { recursion?: boolean }} */ (err).recursion, true, ); done(); }, ); }); it("should detect recursion against Set entries at deeper resolve steps", (t, done) => { // `parsedResolve` runs after the top-level `resolve` hook, so // pre-seeding its entry only triggers recursion at a deeper // `doResolve` call. This exercises the path where the legacy Set // needs to be propagated through the StackEntry chain, not just // checked on the first call. const deeperEntry = `parsedResolve: (${fixture}) ./foo`; resolver.resolve( {}, fixture, "./foo", { stack: new Set([deeperEntry]) }, (err) => { assert.ok(err); assert.strictEqual( /** @type {Error & { recursion?: boolean }} */ (err).recursion, true, ); done(); }, ); }); // Reset patterns for the StackEntry API. With the legacy Set the canonical // reset between resolve calls was assigning `stack = new Set()` on a reused // context. StackEntry isn't user-constructible, so the equivalent reset is // either omitting `stack` or assigning `undefined`. Both forms must clear // any prior pre-seeded entries so a follow-up resolve no longer recurses. it("should reset the stack by assigning `undefined` (StackEntry equivalent of `new Set()`)", (t, done) => { // First call: pre-seed an entry that triggers recursion immediately. // Reuse the same `ctx` object on the second call after clearing the // field — the resolve must succeed because the seeded entry is gone. /** @type {import("../").ResolveContext} */ const ctx = { stack: new Set([`resolve: (${fixture}) ./foo`]) }; resolver.resolve({}, fixture, "./foo", ctx, (err) => { assert.ok(err); assert.strictEqual( /** @type {Error & { recursion?: boolean }} */ (err).recursion, true, ); ctx.stack = undefined; resolver.resolve({}, fixture, "./foo", ctx, (err2, result) => { if (err2) return done(err2); assert.ok(result); done(); }); }); }); it("should reset the stack by assigning a fresh `new Set()` on a reused context", (t, done) => { // Same pattern, but using the legacy Set form for the reset to confirm // back-compat: a fresh empty Set clears the recursion guard just like // `undefined` does. /** @type {import("../").ResolveContext} */ const ctx = { stack: new Set([`resolve: (${fixture}) ./foo`]) }; resolver.resolve({}, fixture, "./foo", ctx, (err) => { assert.ok(err); assert.strictEqual( /** @type {Error & { recursion?: boolean }} */ (err).recursion, true, ); ctx.stack = new Set(); resolver.resolve({}, fixture, "./foo", ctx, (err2, result) => { if (err2) return done(err2); assert.ok(result); done(); }); }); }); // Plugin pattern: a cache plugin (e.g. webpack's ResolverCachePlugin) // taps into a hook and, on a cache miss, re-issues a fresh // `resolver.resolve()` to populate the cache. The inner call needs to // preserve the parent context (log, deps, yield) but start with an // empty recursion-tracking stack — otherwise it inherits the outer // chain and the guard fires on the first inner step (the same // `resolve: (path) request` it just pushed). // // Old API: `{ ...resolveContext, stack: new Set() }`. // New API (works today, future-proof once Set support is dropped): // `{ ...resolveContext, stack: undefined }`. describe("re-issuing resolves from inside a hook (cache-plugin pattern)", () => { /** * @param {boolean} resetStack whether the plugin clears `stack` * @returns {import("../").Resolver} resolver */ const buildReplayResolver = (resetStack) => { let didReplay = false; return ResolverFactory.createResolver({ extensions: [".ts", ".js"], fileSystem: nodeFileSystem, plugins: [ { /** @param {import("../").Resolver} r resolver */ apply(r) { const target = r.ensureHook("parsed-resolve"); r.getHook("resolve").tapAsync( "ReplayPlugin", (request, resolveContext, callback) => { if (didReplay) { // Inner pass: continue normally so the test // actually finishes its resolve. return r.doResolve( target, request, null, resolveContext, callback, ); } didReplay = true; r.resolve( /** @type {import("../").Context} */ (request.context || {}), /** @type {string} */ (request.path), /** @type {string} */ (request.request), resetStack ? { ...resolveContext, stack: undefined } : resolveContext, (err, _result, fullResult) => { if (err) return callback(err); callback(null, fullResult); }, ); }, ); }, }, ], }); }; it("succeeds when the plugin resets `stack` to undefined before re-issuing", (t, done) => { buildReplayResolver(true).resolve( {}, fixture, "./foo", {}, (err, result) => { if (err) return done(err); assert.ok(result); done(); }, ); }); it("trips the recursion guard if the plugin forgets to reset `stack`", (t, done) => { // Negative control: confirms the reset above isn't a no-op. // Without it, the inner `resolver.resolve()` inherits the outer // chain, sees its own `resolve: (...)` entry already on the stack, // and aborts. buildReplayResolver(false).resolve({}, fixture, "./foo", {}, (err) => { assert.ok(err); assert.strictEqual( /** @type {Error & { recursion?: boolean }} */ (err).recursion, true, ); done(); }); }); }); // Regression for #567: a plugin tapped on the `resolved` hook spreads // the stack and runs `String.prototype` methods on each entry. Pre-5.21 // this worked because `stack` was a `Set`; the iterator must // keep yielding strings so the snippet from the issue doesn't TypeError. it("supports `[...resolveContext.stack].find(a => a.includes(...))` (issue #567)", (t, done) => { /** @type {string | undefined} */ let moduleEntry; const plugin = { /** @param {import("../").Resolver} r resolver */ apply(r) { r.ensureHook("resolved").tapAsync( "DependencyDedupePlugin", (_resolved, resolveContext, callback) => { if (resolveContext.stack && moduleEntry === undefined) { const { stack } = /** @type {{ stack: Iterable }} */ (resolveContext); moduleEntry = [...stack].find((a) => a.includes("module:")); } callback(); }, ); }, }; // Resolve a bare specifier so the resolver enters the `module` hook // and pushes a `module: (...)` entry onto the stack. const r = ResolverFactory.createResolver({ extensions: [".ts", ".js"], modules: [path.resolve(__dirname, "fixtures/node_modules")], fileSystem: nodeFileSystem, plugins: [plugin], }); r.resolve({}, fixture, "m1/a", {}, (err, result) => { if (err) return done(err); assert.ok(result); const entry = /** @type {string} */ (moduleEntry); assert.ok(entry); assert.strictEqual(typeof entry, "string"); assert.match(entry, /^module: \(.+\) \.\//); // The exact regex from the issue's `DependencyDedupePlugin` // plugin: strip the `module: (path) ./` prefix and keep the // rest. For a `m1/a` request that yields `"m1/a"`. assert.strictEqual( entry.replace(/^(module: \(.+\) \.\/)(?=.+$)/, ""), "m1/a", ); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/resolve-logging.test.js000066400000000000000000000074601523262174200245420ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const resolve = require("../"); const { describe, it } = require("./_runner"); const fixtures = path.join(__dirname, "fixtures"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); describe("directory/file existence logging", () => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], }); it("logs 'doesn't exist' when a directory is missing during resolution", (t, done) => { const log = []; resolver.resolve( {}, fixtures, "./does-not-exist", { log: (m) => log.push(m) }, (err) => { assert.ok(err instanceof Error); assert.strictEqual( log.some((l) => l.includes("doesn't exist")), true, ); done(); }, ); }); it("tracks missing directories in resolveContext.missingDependencies", (t, done) => { const missingDependencies = new Set(); resolver.resolve( {}, fixtures, "./does-not-exist", { missingDependencies }, (err) => { assert.ok(err instanceof Error); assert.ok(missingDependencies.size > 0); done(); }, ); }); }); describe("fragment handling (ParsePlugin)", () => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], }); it("preserves unique fragments when parsing requests", (t, done) => { resolver.resolve({}, fixtures, "./a.js#frag", {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, `${path.join(fixtures, "a.js")}#frag`); done(); }); }); it("preserves queries together with fragments", (t, done) => { resolver.resolve({}, fixtures, "./a.js?q#f", {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, `${path.join(fixtures, "a.js")}?q#f`); done(); }); }); }); describe("resolver resolves request without a fragment or module marker", () => { // Exercises the LogInfoPlugin false-valued branches by resolving a request // that has no directory/module/query/fragment/descriptionFile attached. const LogInfoPlugin = require("../lib/LogInfoPlugin"); it("runs without logging query/fragment/module/directory lines", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], plugins: [new LogInfoPlugin("file")], }); const log = []; resolver.resolve( {}, fixtures, "./a.js", { log: (m) => log.push(m) }, (err) => { if (err) return done(err); // The "file" hook sees a request where module/directory are false and // query/fragment are empty — so these branches are skipped. assert.strictEqual( log.some((l) => l.includes("[file] Resolving in")), true, ); assert.strictEqual( log.some((l) => l.includes("Request is a directory")), false, ); assert.strictEqual( log.some((l) => l.includes("Request is an module")), false, ); done(); }, ); }); }); // A convenience sanity check that the full top-level resolve() works. describe("top-level resolve()", () => { it("resolves a fixture with the default node resolver", (t, done) => { resolve(fixtures, "./a.js", (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(fixtures, "a.js")); done(); }); }); }); describe("resolving a directory as a file (FileExistsPlugin 'is not a file' branch)", () => { it("emits an error when enforceExtension matches a directory", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, enforceExtension: true, extensions: [".js"], }); resolver.resolve({}, fixtures, "./directory-default", {}, (err) => { assert.ok(err instanceof Error); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/resolve.test.js000066400000000000000000000231311523262174200231070ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const path = require("path"); const url = require("url"); const resolve = require("../"); const { describe, it } = require("./_runner"); const fixtures = path.join(__dirname, "fixtures"); const asyncContextResolve = resolve.create({ extensions: [".js", ".json", ".node"], resolveToContext: true, }); const syncContextResolve = resolve.create.sync({ extensions: [".js", ".json", ".node"], resolveToContext: true, }); const promiseContextResolve = resolve.create.promise({ extensions: [".js", ".json", ".node"], resolveToContext: true, }); const issue238Resolve = resolve.create({ extensions: [".js", ".jsx", ".ts", ".tsx"], modules: ["src/a", "src/b", "src/common", "node_modules"], }); const preferRelativeResolve = resolve.create({ preferRelative: true, }); /** * @param {string} name name * @param {string} context context * @param {string} moduleName module name * @param {string} result result * @returns {void} */ function testResolve(name, context, moduleName, result) { describe(name, () => { it("should resolve sync correctly", () => { const filename = resolve.sync(context, moduleName); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual(filename, result); }); it("should resolve async correctly", (t, done) => { resolve(context, moduleName, (err, filename) => { if (err) return done(err); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual(filename, result); done(); }); }); it("should resolve promise correctly", async () => { const filename = await resolve.promise(context, moduleName); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual(filename, result); }); }); } /** * @param {string} name name * @param {string} context context * @param {string} moduleName module name * @param {string} result result * @returns {void} */ function testResolveContext(name, context, moduleName, result) { describe(name, () => { it("should resolve async correctly", (t, done) => { asyncContextResolve(context, moduleName, (err, filename) => { if (err) done(err); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual(filename, result); done(); }); }); it("should resolve sync correctly", () => { const filename = syncContextResolve(context, moduleName); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual(filename, result); }); it("should resolve promise correctly", async () => { const filename = await promiseContextResolve(context, moduleName); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual(filename, result); }); }); } describe("resolve", () => { testResolve( "absolute path", fixtures, path.join(fixtures, "main1.js"), path.join(fixtures, "main1.js"), ); testResolve( "file with .js", fixtures, "./main1.js", path.join(fixtures, "main1.js"), ); testResolve( "file without extension", fixtures, "./main1", path.join(fixtures, "main1.js"), ); testResolve( "another file with .js", fixtures, "./a.js", path.join(fixtures, "a.js"), ); testResolve( "another file without extension", fixtures, "./a", path.join(fixtures, "a.js"), ); testResolve( "file in module with .js", fixtures, "m1/a.js", path.join(fixtures, "node_modules", "m1", "a.js"), ); testResolve( "file in module without extension", fixtures, "m1/a", path.join(fixtures, "node_modules", "m1", "a.js"), ); testResolve( "another file in module without extension", fixtures, "complexm/step1", path.join(fixtures, "node_modules", "complexm", "step1.js"), ); testResolve( "from submodule to file in sibling module", path.join(fixtures, "node_modules", "complexm"), "m2/b.js", path.join(fixtures, "node_modules", "m2", "b.js"), ); testResolve( "from submodule to file in sibling of parent module", path.join(fixtures, "node_modules", "complexm", "web_modules", "m1"), "m2/b.js", path.join(fixtures, "node_modules", "m2", "b.js"), ); testResolve( "from nested directory to overwritten file in module", path.join(fixtures, "multiple_modules"), "m1/a.js", path.join(fixtures, "multiple_modules", "node_modules", "m1", "a.js"), ); testResolve( "from nested directory to not overwritten file in module", path.join(fixtures, "multiple_modules"), "m1/b.js", path.join(fixtures, "node_modules", "m1", "b.js"), ); testResolve( "file with query", fixtures, "./main1.js?query", `${path.join(fixtures, "main1.js")}?query`, ); testResolve( "file with fragment", fixtures, "./main1.js#fragment", `${path.join(fixtures, "main1.js")}#fragment`, ); testResolve( "file with fragment and query", fixtures, "./main1.js#fragment?query", `${path.join(fixtures, "main1.js")}#fragment?query`, ); testResolve( "file with query and fragment", fixtures, "./main1.js?#fragment", `${path.join(fixtures, "main1.js")}?#fragment`, ); testResolve( "file in module with query", fixtures, "m1/a?query", `${path.join(fixtures, "node_modules", "m1", "a.js")}?query`, ); testResolve( "file in module with fragment", fixtures, "m1/a#fragment", `${path.join(fixtures, "node_modules", "m1", "a.js")}#fragment`, ); testResolve( "file in module with fragment and query", fixtures, "m1/a#fragment?query", `${path.join(fixtures, "node_modules", "m1", "a.js")}#fragment?query`, ); testResolve( "file in module with query and fragment", fixtures, "m1/a?#fragment", `${path.join(fixtures, "node_modules", "m1", "a.js")}?#fragment`, ); testResolveContext("context for fixtures", fixtures, "./", fixtures); testResolveContext( "context for fixtures/lib", fixtures, "./lib", path.join(fixtures, "lib"), ); testResolveContext( "context for fixtures with ..", fixtures, "./lib/../../fixtures/./lib/..", fixtures, ); testResolveContext( "context for fixtures with query", fixtures, "./?query", `${fixtures}?query`, ); testResolve( "differ between directory and file, resolve file", fixtures, "./dirOrFile", path.join(fixtures, "dirOrFile.js"), ); testResolve( "differ between directory and file, resolve directory", fixtures, "./dirOrFile/", path.join(fixtures, "dirOrFile", "index.js"), ); testResolve( "find node_modules outside of node_modules", path.join(fixtures, "browser-module", "node_modules"), "m1/a", path.join(fixtures, "node_modules", "m1", "a.js"), ); testResolve( "don't crash on main field pointing to self", fixtures, "./main-field-self", path.join(fixtures, "main-field-self", "index.js"), ); testResolve( "don't crash on main field pointing to self", fixtures, "./main-field-self2", path.join(fixtures, "main-field-self2", "index.js"), ); testResolve( "handle fragment edge case (no fragment)", fixtures, "./no#fragment/#/#", path.join(fixtures, "no\0#fragment/\0#", "\0#.js"), ); testResolve( "handle fragment edge case (fragment)", fixtures, "./no#fragment/#/", `${path.join(fixtures, "no.js")}#fragment/#/`, ); testResolve( "handle fragment escaping", fixtures, "./no\0#fragment/\0#/\0##fragment", `${path.join(fixtures, "no\0#fragment/\0#", "\0#.js")}#fragment`, ); testResolve( "handle file URL", fixtures, url.pathToFileURL(path.resolve(fixtures, "./main1.js")).toString(), path.join(fixtures, "main1.js"), ); testResolve( "handle file URL with query", fixtures, `${url .pathToFileURL(path.resolve(fixtures, "./main1.js")) .toString()}?query`, path.join(fixtures, "main1.js"), ); testResolve( "handle file URL with fragment", fixtures, `${url .pathToFileURL(path.resolve(fixtures, "./main1.js")) .toString()}#fragment`, path.join(fixtures, "main1.js"), ); testResolve( "handle file URL with query and fragment", fixtures, `${url .pathToFileURL(path.resolve(fixtures, "./main1.js")) .toString()}?query#fragment`, path.join(fixtures, "main1.js"), ); it("should correctly resolve", (t, done) => { const issue238 = path.resolve(fixtures, "issue-238"); issue238Resolve( path.resolve(issue238, "./src/common"), "config/myObjectFile", (err, filename) => { if (err) done(err); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual( filename, path.resolve(issue238, "./src/common/config/myObjectFile.js"), ); done(); }, ); }); it("should correctly resolve with preferRelative", (t, done) => { preferRelativeResolve(fixtures, "main1.js", (err, filename) => { if (err) done(err); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual(filename, path.join(fixtures, "main1.js")); done(); }); }); it("should correctly resolve with preferRelative #2", (t, done) => { preferRelativeResolve(fixtures, "m1/a.js", (err, filename) => { if (err) done(err); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual( filename, path.join(fixtures, "node_modules", "m1", "a.js"), ); done(); }); }); it("should not crash when passing undefined as path", (t, done) => { // @ts-expect-error testing invalid arguments resolve(fixtures, undefined, (err) => { assert.ok(err instanceof Error); done(); }); }); it("should not crash when passing undefined as context", (t, done) => { // @ts-expect-error testing invalid arguments resolve({}, undefined, "./test/resolve.js", (err) => { assert.ok(err instanceof Error); done(); }); }); it("should not crash when passing undefined everywhere", (t, done) => { // @ts-expect-error testing invalid arguments resolve(undefined, undefined, undefined, undefined, (err) => { assert.ok(err instanceof Error); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/resolver-cache.test.js000066400000000000000000000126271523262174200243420ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { dirname, join } = require("../lib/util/path"); const { describe, it } = require("./_runner"); describe("Resolver join/dirname cache", () => { describe("when unsafeCache is enabled", () => { it("should share pathCache across resolvers with the same fileSystem", () => { const fileSystem = new CachedInputFileSystem(fs, 0); const resolver1 = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); const resolver2 = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); assert.strictEqual(resolver1.pathCache, resolver2.pathCache); }); it("should use independent caches for different fileSystems", () => { const fileSystem1 = new CachedInputFileSystem(fs, 0); const fileSystem2 = new CachedInputFileSystem(fs, 0); const resolver1 = ResolverFactory.createResolver({ fileSystem: fileSystem1, extensions: [".js"], unsafeCache: true, }); const resolver2 = ResolverFactory.createResolver({ fileSystem: fileSystem2, extensions: [".js"], unsafeCache: true, }); assert.notStrictEqual(resolver1.pathCache, resolver2.pathCache); }); it("should produce correct results", () => { const fileSystem = new CachedInputFileSystem(fs, 0); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); assert.strictEqual(resolver.join("/a/b", "c"), join("/a/b", "c")); assert.strictEqual(resolver.dirname("/a/b/c"), dirname("/a/b/c")); assert.strictEqual(resolver.basename("/a/b/c"), path.basename("/a/b/c")); assert.strictEqual( resolver.basename("/a/b/c.ext", ".ext"), path.basename("/a/b/c.ext", ".ext"), ); assert.strictEqual( resolver.basename("/a/b/c.ext"), path.basename("/a/b/c.ext"), ); assert.strictEqual( resolver.basename("/a/b/c.ext", ".other"), path.basename("/a/b/c.ext", ".other"), ); }); it("should clear all caches when calling pathCache.clear()", () => { const fileSystem = new CachedInputFileSystem(fs, 0); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); resolver.join("/a/b", "c"); resolver.dirname("/a/b/c"); resolver.basename("/a/b/c"); assert.ok(resolver.pathCache.join.cache.size > 0); assert.ok(resolver.pathCache.dirname.cache.size > 0); assert.ok(resolver.pathCache.basename.cache.size > 0); resolver.pathCache.join.cache.clear(); resolver.pathCache.dirname.cache.clear(); resolver.pathCache.basename.cache.clear(); assert.strictEqual(resolver.pathCache.join.cache.size, 0); assert.strictEqual(resolver.pathCache.dirname.cache.size, 0); assert.strictEqual(resolver.pathCache.basename.cache.size, 0); // Still works after clearing assert.strictEqual(resolver.join("/a/b", "c"), join("/a/b", "c")); assert.strictEqual(resolver.dirname("/a/b/c"), dirname("/a/b/c")); assert.strictEqual(resolver.basename("/a/b/c"), path.basename("/a/b/c")); }); it("should clear only join cache when calling pathCache.join.clear()", () => { const fileSystem = new CachedInputFileSystem(fs, 0); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); resolver.join("/a/b", "c"); resolver.dirname("/a/b/c"); resolver.basename("/a/b/c"); resolver.pathCache.join.cache.clear(); assert.strictEqual(resolver.pathCache.join.cache.size, 0); assert.ok(resolver.pathCache.dirname.cache.size > 0); assert.ok(resolver.pathCache.basename.cache.size > 0); }); it("should clear only dirname cache when calling pathCache.dirname.clear()", () => { const fileSystem = new CachedInputFileSystem(fs, 0); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); resolver.join("/a/b", "c"); resolver.dirname("/a/b/c"); resolver.basename("/a/b/c"); resolver.pathCache.dirname.cache.clear(); assert.ok(resolver.pathCache.join.cache.size > 0); assert.strictEqual(resolver.pathCache.dirname.cache.size, 0); assert.ok(resolver.pathCache.basename.cache.size > 0); }); it("should clear only dirname cache when calling pathCache.basename.clear()", () => { const fileSystem = new CachedInputFileSystem(fs, 0); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], unsafeCache: true, }); resolver.join("/a/b", "c"); resolver.dirname("/a/b/c"); resolver.basename("/a/b/c.ext", ".ext"); resolver.pathCache.basename.cache.clear(); assert.ok(resolver.pathCache.join.cache.size > 0); assert.ok(resolver.pathCache.dirname.cache.size > 0); assert.strictEqual(resolver.pathCache.basename.cache.size, 0); }); }); describe("when unsafeCache is disabled", () => { it("should share pathCache across resolvers with the same fileSystem", () => { const fileSystem = new CachedInputFileSystem(fs, 0); const resolver1 = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); const resolver2 = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], }); assert.strictEqual(resolver1.pathCache, resolver2.pathCache); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/restrictions.test.js000066400000000000000000000522241523262174200241650ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { AsyncSeriesBailHook } = require("tapable"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const ResolverFactory = require("../lib/ResolverFactory"); const RestrictionsPlugin = require("../lib/RestrictionsPlugin"); const { after, describe, it } = require("./_runner"); const fixture = path.resolve(__dirname, "fixtures", "restrictions"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); describe("restrictions", () => { it("should respect RegExp restriction", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, restrictions: [/\.(sass|scss|css)$/], }); resolver.resolve({}, fixture, "pck1", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); done(); }); }); it("should try to find alternative #1", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js", ".css"], fileSystem: nodeFileSystem, mainFiles: ["index"], restrictions: [/\.(sass|scss|css)$/], }); resolver.resolve({}, fixture, "pck1", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/pck1/index.css"), ); done(); }); }); it("should respect string restriction", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, restrictions: [fixture], }); resolver.resolve({}, fixture, "pck2", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); done(); }); }); it("should try to find alternative #2", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFields: ["main", "style"], restrictions: [fixture, /\.(sass|scss|css)$/], }); resolver.resolve({}, fixture, "pck2", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/pck2/index.css"), ); done(); }); }); it("should try to find alternative #3", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], fileSystem: nodeFileSystem, mainFields: ["main", "module", "style"], restrictions: [fixture, /\.(sass|scss|css)$/], }); const log = []; resolver.resolve( {}, fixture, "pck2", { log: log.push.bind(log) }, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "node_modules/pck2/index.css"), ); assert.deepStrictEqual( log.map((line) => line .replace(path.resolve(__dirname, ".."), "...") .replace(path.resolve(__dirname, ".."), "...") .replace(/\\/g, "/"), ), [ "resolve 'pck2' in '.../test/fixtures/restrictions'", " Parsed request is a module", " using description file: .../package.json (relative path: ./test/fixtures/restrictions)", " resolve as module", " looking for modules in .../test/fixtures/restrictions/node_modules", " single file module", " using description file: .../package.json (relative path: ./test/fixtures/restrictions/node_modules/pck2)", " no extension", " .../test/fixtures/restrictions/node_modules/pck2 is not a file", " .js", " .../test/fixtures/restrictions/node_modules/pck2.js doesn't exist", " existing directory .../test/fixtures/restrictions/node_modules/pck2", " using description file: .../test/fixtures/restrictions/node_modules/pck2/package.json (relative path: .)", " using description file: .../package.json (relative path: ./test/fixtures/restrictions/node_modules/pck2)", " no extension", " .../test/fixtures/restrictions/node_modules/pck2 is not a file", " .js", " .../test/fixtures/restrictions/node_modules/pck2.js doesn't exist", " as directory", " existing directory .../test/fixtures/restrictions/node_modules/pck2", " using description file: .../test/fixtures/restrictions/node_modules/pck2/package.json (relative path: .)", " use ../../../c.js from main in package.json", " using description file: .../package.json (relative path: ./test/fixtures/c.js)", " no extension", " existing file: .../test/fixtures/c.js", " .../test/fixtures/c.js is not inside of the restriction .../test/fixtures/restrictions", " .js", " .../test/fixtures/c.js.js doesn't exist", " as directory", " .../test/fixtures/c.js is not a directory", " use ./module.js from module in package.json", " using description file: .../test/fixtures/restrictions/node_modules/pck2/package.json (relative path: ./module.js)", " no extension", " existing file: .../test/fixtures/restrictions/node_modules/pck2/module.js", " .../test/fixtures/restrictions/node_modules/pck2/module.js doesn't match the restriction //.(sass|scss|css)$/", " .js", " .../test/fixtures/restrictions/node_modules/pck2/module.js.js doesn't exist", " as directory", " .../test/fixtures/restrictions/node_modules/pck2/module.js is not a directory", " use ./index.css from style in package.json", " using description file: .../test/fixtures/restrictions/node_modules/pck2/package.json (relative path: ./index.css)", " no extension", " existing file: .../test/fixtures/restrictions/node_modules/pck2/index.css", " reporting result .../test/fixtures/restrictions/node_modules/pck2/index.css", ], ); done(); }, ); }); it("should throw an error when the path is outside a string restriction", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], restrictions: ["/definitely/not/here"], }); const log = []; resolver.resolve( {}, fixture, "pck1", { log: (m) => log.push(m) }, (err) => { assert.ok(err instanceof Error); assert.strictEqual( log.some((l) => l.includes("is not inside of the restriction")), true, ); done(); }, ); }); it("should throw an error when the path does not match a regex restriction", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], restrictions: [/\.ts$/], }); const log = []; resolver.resolve( {}, fixture, "pck1", { log: (m) => log.push(m) }, (err) => { assert.ok(err instanceof Error); assert.strictEqual( log.some((l) => l.includes("doesn't match the restriction")), true, ); done(); }, ); }); describe("path boundaries", () => { // The resolver handles both path flavors on every host, so a fake // filesystem is used to run the posix and the Windows cases everywhere. const createFileSystem = (file) => { const enoent = (requested) => { const err = /** @type {NodeJS.ErrnoException} */ ( new Error(`ENOENT: no such file or directory, '${requested}'`) ); err.code = "ENOENT"; throw err; }; const fileSystem = { statSync: (requested) => requested === file ? { isFile: () => true, isDirectory: () => false, isSymbolicLink: () => false, } : enoent(requested), lstatSync: (requested) => fileSystem.statSync(requested), readFileSync: enoent, readdirSync: enoent, readlinkSync: enoent, }; return fileSystem; }; const testCases = [ { title: "a file inside a posix restriction", restriction: "/a/b/c", context: "/a/b/c", request: "./index.js", file: "/a/b/c/index.js", allowed: true, }, { title: "a sibling of a posix restriction", restriction: "/a/b/c", context: "/a/b", request: "./c-other.js", file: "/a/b/c-other.js", allowed: false, }, { // `\` is a regular filename character on posix, so this file is a // sibling of the restriction and not inside of it title: "a sibling of a posix restriction separated by a backslash", restriction: "/a/b/c", context: "/a/b", request: "./c\\sibling.js", file: "/a/b/c\\sibling.js", allowed: false, }, { title: "a file inside a posix restriction ending with a separator", restriction: "/a/b/c/", context: "/a/b/c", request: "./index.js", file: "/a/b/c/index.js", allowed: true, }, { title: "a file inside the posix root restriction", restriction: "/", context: "/a", request: "./index.js", file: "/a/index.js", allowed: true, }, { title: "a file inside a non-normalized posix restriction", restriction: "/a/x/../b/c", context: "/a/b/c", request: "./index.js", file: "/a/b/c/index.js", allowed: true, }, { title: "a file inside a windows restriction", restriction: "C:\\a\\b\\c", context: "C:\\a\\b\\c", request: "./index.js", file: "C:\\a\\b\\c\\index.js", allowed: true, }, { title: "a sibling of a windows restriction", restriction: "C:\\a\\b\\c", context: "C:\\a\\b", request: "./c-other.js", file: "C:\\a\\b\\c-other.js", allowed: false, }, { title: "a file inside a windows restriction ending with a separator", restriction: "C:\\a\\b\\c\\", context: "C:\\a\\b\\c", request: "./index.js", file: "C:\\a\\b\\c\\index.js", allowed: true, }, { title: "a file inside a windows restriction written with slashes", restriction: "C:/a/b/c", context: "C:\\a\\b\\c", request: "./index.js", file: "C:\\a\\b\\c\\index.js", allowed: true, }, { title: "a file inside a windows restriction from a mixed context", restriction: "C:\\a\\b\\c", context: "C:/a\\b", request: "./c/index.js", file: "C:\\a\\b\\c\\index.js", allowed: true, }, { title: "a file inside a windows restriction differing in case", restriction: "C:\\A\\B\\C", context: "c:\\a\\b\\c", request: "./index.js", file: "c:\\a\\b\\c\\index.js", allowed: true, }, { title: "a file inside a posix restriction differing in case", restriction: "/A/B/C", context: "/a/b/c", request: "./index.js", file: "/a/b/c/index.js", allowed: false, }, ]; for (const { title, restriction, context, request, file, allowed, } of testCases) { it(`should ${allowed ? "resolve" : "not resolve"} ${title}`, (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], useSyncFileSystemCalls: true, // @ts-expect-error a minimal filesystem is enough for these cases fileSystem: createFileSystem(file), restrictions: [restriction], }); resolver.resolve({}, context, request, {}, (err, result) => { if (allowed) { if (err) return done(err); assert.deepStrictEqual(result, file); } else { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); } done(); }); }); } }); describe("windows and posix semantics", () => { // Windows accepts `/` and `\` interchangeably and mixed within one path, // and compares case-insensitively; posix does neither. The plugin is // driven directly because the resolver normalizes a path before it // reaches the plugin, so those forms cannot arrive through it. const testCases = [ { title: "a windows path using slashes under a backslash restriction", restriction: "C:\\a\\b\\c", path: "C:/a/b/c/index.js", inside: true, }, { title: "a windows path mixing separators under a slash restriction", restriction: "C:/a/b/c", path: "C:\\a\\b/c/index.js", inside: true, }, { title: "a windows path under a restriction ending with a slash", restriction: "C:\\a\\b\\c/", path: "C:\\a\\b\\c\\index.js", inside: true, }, { title: "a windows path differing in case from its restriction", restriction: "C:\\a\\b\\c", path: "c:\\A\\B\\C\\index.js", inside: true, }, { title: "the restricted directory itself", restriction: "/a/b/c/", path: "/a/b/c", inside: true, }, { title: "a path inside a UNC restriction", restriction: "\\\\server\\share\\a", path: "\\\\SERVER\\share\\a\\index.js", inside: true, }, { title: "a path inside a DOS device restriction", restriction: "\\\\?\\C:\\a", path: "\\\\?\\C:\\a\\index.js", inside: true, }, { title: "a path on another share than the UNC restriction", restriction: "\\\\server\\share\\a", path: "\\\\server\\other\\a\\index.js", inside: false, }, { title: "a sibling of a windows restriction written with slashes", restriction: "C:\\a\\b\\c", path: "C:/a/b/c-other.js", inside: false, }, { // separators are never interchangeable outside of windows paths title: "a posix sibling separated by a backslash", restriction: "/a/b/c", path: "/a/b/c\\sibling.js", inside: false, }, { // the restriction contains a backslash but is still a posix path, // so the backslash names a directory instead of separating one title: "a posix sibling of a restriction containing a backslash", restriction: "/a/b\\c", path: "/a/b\\c\\sibling.js", inside: false, }, { title: "a posix path differing in case from its restriction", restriction: "/a/b/c", path: "/A/B/C/index.js", inside: false, }, ]; for (const { title, restriction, path: requestPath, inside } of testCases) { it(`should ${inside ? "allow" : "reject"} ${title}`, (t, done) => { const hook = new AsyncSeriesBailHook(["request", "resolveContext"]); new RestrictionsPlugin(hook, new Set([restriction])).apply( // @ts-expect-error a minimal resolver is enough for this plugin { getHook: () => hook }, ); hook.callAsync({ path: requestPath }, {}, (err, result) => { if (err) return done(err); // the plugin bails with `null` when it filters a request out assert.strictEqual(result !== null, inside); done(); }); }); } }); describe("compared with node's path api", () => { // Containment is Node's answer, not ours: a target is inside a parent // when `relative(parent, target)` neither escapes upward nor is absolute. // Which flavor answers is where `win32` and `posix` disagree about the // root of the restriction. const isWindowsPath = (maybePath) => path.win32.parse(maybePath).root !== path.posix.parse(maybePath).root; const nodeSaysInside = (parent, target) => { const flavor = isWindowsPath(parent) ? path.win32 : path.posix; const relative = flavor.relative(parent, target); return ( relative === "" || (!relative.startsWith("..") && !flavor.isAbsolute(relative)) ); }; const restrictions = [ "/a/b/c", "/a/b/c/", "/a/b\\c", "/", "C:\\a\\b\\c", "C:\\a\\b\\c\\", "C:/a/b/c", "C:\\", "\\\\server\\share\\a", "\\\\?\\C:\\a", ]; const swapSeparators = (maybePath) => maybePath.replace(/[\\/]/g, (char) => (char === "/" ? "\\" : "/")); const targetsFor = (restriction) => { const separator = isWindowsPath(restriction) ? "\\" : "/"; const other = separator === "\\" ? "/" : "\\"; const trimmed = restriction.replace(/[\\/]+$/, "") || separator; const targets = new Set(); for (const base of [ trimmed, swapSeparators(trimmed), trimmed.toUpperCase(), trimmed.toLowerCase(), ]) { for (const suffix of [ "", `${separator}index.js`, `${other}index.js`, `${separator}sub${other}index.js`, "-other.js", "\\sibling.js", ]) { targets.add(base + suffix); } } for (const unrelated of [ "/unrelated/index.js", "D:\\unrelated\\index.js", "\\\\server\\other\\index.js", ]) { targets.add(unrelated); } return [...targets]; }; let insideCount = 0; let outsideCount = 0; for (const restriction of restrictions) { for (const target of targetsFor(restriction)) { const flavor = isWindowsPath(restriction) ? path.win32 : path.posix; // `relative` resolves a non-absolute input against `process.cwd()`, // which says nothing about containment if (!flavor.isAbsolute(restriction) || !flavor.isAbsolute(target)) { continue; } // a `.`/`..` segment or a doubled separator never reaches the plugin, // the resolver normalizes those away first - a mixed separator does // survive on windows, so only the separators are canonicalized here const canonical = isWindowsPath(restriction) ? target.replace(/\//g, "\\") : target; if (flavor.normalize(canonical) !== canonical) continue; const inside = nodeSaysInside(restriction, target); if (inside) { insideCount++; } else { outsideCount++; } it(`should ${inside ? "allow" : "reject"} ${JSON.stringify(target)} under ${JSON.stringify(restriction)}`, (t, done) => { const hook = new AsyncSeriesBailHook(["request", "resolveContext"]); new RestrictionsPlugin(hook, new Set([restriction])).apply( // @ts-expect-error a minimal resolver is enough for this plugin { getHook: () => hook }, ); hook.callAsync({ path: target }, {}, (err, result) => { if (err) return done(err); assert.strictEqual(result !== null, inside); done(); }); }); } } it("should have compared both verdicts", () => { // guards against a generator change quietly emptying the matrix above assert.ok(insideCount > 50, `only ${insideCount} inside cases`); assert.ok(outsideCount > 50, `only ${outsideCount} outside cases`); }); }); describe("with symlinks", () => { const symlinkRoot = path.resolve(__dirname, "temp-restrictions-symlink"); const allowed = path.join(symlinkRoot, "allowed"); const outside = path.join(symlinkRoot, "outside"); let canSymlink = true; try { fs.mkdirSync(allowed, { recursive: true }); fs.mkdirSync(outside, { recursive: true }); fs.writeFileSync(path.join(outside, "secret.js"), "module.exports = 1;"); fs.writeFileSync(path.join(allowed, "real.js"), "module.exports = 2;"); fs.symlinkSync( path.join(outside, "secret.js"), path.join(allowed, "link.js"), "file", ); fs.symlinkSync( path.join("..", "outside", "secret.js"), path.join(allowed, "rel-link.js"), "file", ); } catch (_err) { canSymlink = false; } after(() => { for (const file of [ path.join(allowed, "link.js"), path.join(allowed, "rel-link.js"), path.join(allowed, "real.js"), path.join(outside, "secret.js"), ]) { try { fs.unlinkSync(file); } catch (_err) { // ignore } } for (const dir of [allowed, outside, symlinkRoot]) { try { fs.rmdirSync(dir); } catch (_err) { // ignore } } }); if (canSymlink) { it("should reject an in-root symlink whose real target is outside the restriction", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], restrictions: [allowed], }); resolver.resolve({}, allowed, "./link.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); done(); }); }); it("should reject an in-root relative symlink whose real target is outside the restriction", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], restrictions: [allowed], }); resolver.resolve({}, allowed, "./rel-link.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); done(); }); }); it("should still resolve a real in-root file under the restriction", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], restrictions: [allowed], }); resolver.resolve({}, allowed, "./real.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(allowed, "real.js")); done(); }); }); } else { it("cannot test symlinks because we have no permission to create them", () => { // Nothing }); } }); }); webpack-enhanced-resolve-7dfc9bc/test/roots.test.js000066400000000000000000000107741523262174200226070ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const ResolverFactory = require("../lib/ResolverFactory"); const { describe, it } = require("./_runner"); describe("roots", () => { const fixtures = path.resolve(__dirname, "fixtures"); const fileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { foo: "/fixtures", }, roots: [__dirname, fixtures], fileSystem, }); const resolverPreferAbsolute = ResolverFactory.createResolver({ extensions: [".js"], alias: { foo: "/fixtures", }, roots: [__dirname, fixtures], fileSystem, preferAbsolute: true, plugins: [ { apply(resolver) { resolver.hooks.file.tap("Test", (request) => { if (/test.fixtures.*test.fixtures/.test(request.path)) { throw new Error("Simulate a fatal error in root path"); } }); }, }, ], }); const contextResolver = ResolverFactory.createResolver({ roots: [__dirname], fileSystem, resolveToContext: true, }); it("should respect roots option", (t, done) => { resolver.resolve({}, fixtures, "/fixtures/b.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); it("should try another root option, if it exists", (t, done) => { resolver.resolve({}, fixtures, "/b.js", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); it("should respect extension", (t, done) => { resolver.resolve({}, fixtures, "/fixtures/b", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); it("should resolve in directory", (t, done) => { resolver.resolve( {}, fixtures, "/fixtures/extensions/dir", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixtures, "extensions/dir/index.js"), ); done(); }, ); }); it("should respect aliases", (t, done) => { resolver.resolve({}, fixtures, "foo/b", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }); }); it("should support roots options with resolveToContext", (t, done) => { contextResolver.resolve( {}, fixtures, "/fixtures/lib", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixtures, "lib")); done(); }, ); }); it("should not work with relative path", (t, done) => { resolver.resolve({}, fixtures, "fixtures/b.js", {}, (err, result) => { if (!err) return done(new Error(`expect error, got ${result}`)); assert.ok(err instanceof Error); done(); }); }); it("should resolve an absolute path (prefer absolute)", (t, done) => { resolverPreferAbsolute.resolve( {}, fixtures, path.join(fixtures, "b.js"), {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.resolve(fixtures, "b.js")); done(); }, ); }); it("should throw an error for empty requests (no root rewriting)", (t, done) => { // Empty request should produce an error, not a root rewrite. resolver.resolve({}, fixtures, "", {}, (err) => { assert.ok(err instanceof Error); done(); }); }); it("should work falls through for relative requests (no root rewriting)", (t, done) => { // Relative request resolves normally (not via roots). resolver.resolve({}, fixtures, "./a.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(fixtures, "a.js")); done(); }); }); it("should rewrites absolute-style requests against roots", (t, done) => { // Absolute request "/a.js" should be rewritten to roots[0] + /a.js resolver.resolve({}, fixtures, "/a.js", {}, (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(fixtures, "a.js")); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/scoped-packages.test.js000066400000000000000000000027441523262174200244700ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const fixture = path.join(__dirname, "fixtures", "scoped"); const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ aliasFields: ["browser"], fileSystem: nodeFileSystem, }); describe("scoped-packages", () => { it("main field should work", (t, done) => { resolver.resolve({}, fixture, "@scope/pack1", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/@scope/pack1/main.js"), ); done(); }); }); it("browser field should work", (t, done) => { resolver.resolve({}, fixture, "@scope/pack2", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/@scope/pack2/main.js"), ); done(); }); }); it("folder request should work", (t, done) => { resolver.resolve({}, fixture, "@scope/pack2/lib", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.resolve(fixture, "./node_modules/@scope/pack2/lib/index.js"), ); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/simple.test.js000066400000000000000000000454111523262174200227260ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const resolve = require("../"); const { CachedInputFileSystem, ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); const fixtures = path.join(__dirname, "fixtures"); describe("simple", () => { const pathsToIt = [ [__dirname, "../lib/index", "direct"], [__dirname, "..", "as directory"], [path.join(__dirname, "..", ".."), "./enhanced-resolve", "as module"], [ path.join(__dirname, "..", ".."), "./enhanced-resolve/lib/index", "in module", ], ]; for (const pathToIt of pathsToIt) { it(`should resolve itself callback ${pathToIt[2]}`, (t, done) => { resolve(pathToIt[0], pathToIt[1], (err, filename) => { if (err) { return done( new Error([err.message, err.stack, err.details].join("\n")), ); } assert.notStrictEqual(filename, undefined); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it(`should resolve itself callback ${pathToIt[2]} and accept context argument`, (t, done) => { resolve({}, pathToIt[0], pathToIt[1], (err, filename) => { if (err) { return done( new Error([err.message, err.stack, err.details].join("\n")), ); } assert.notStrictEqual(filename, undefined); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it(`should resolve itself callback ${pathToIt[2]} and accept a resolveContext argument`, (t, done) => { const resolveContext = {}; resolve({}, pathToIt[0], pathToIt[1], resolveContext, (err, filename) => { if (err) { return done( new Error([err.message, err.stack, err.details].join("\n")), ); } assert.notStrictEqual(filename, undefined); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it(`should resolve itself sync ${pathToIt[2]}`, () => { const filename = resolve.sync(pathToIt[0], pathToIt[1]); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it(`should resolve itself sync ${pathToIt[2]} and accept a context argument`, () => { const filename = resolve.sync({}, pathToIt[0], pathToIt[1]); assert.notStrictEqual(filename, undefined); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it(`should resolve itself promise ${pathToIt[2]} and accept a resolveContext argument`, () => { const resolveContext = {}; const filename = resolve.sync( {}, pathToIt[0], pathToIt[1], resolveContext, ); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it(`should resolve itself promise ${pathToIt[2]}`, async () => { const filename = await resolve.promise(pathToIt[0], pathToIt[1]); assert.notStrictEqual(filename, undefined); assert.strictEqual(typeof filename, "string"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it(`should resolve itself promise ${pathToIt[2]} and accept a context argument`, async () => { const filename = await resolve.promise({}, pathToIt[0], pathToIt[1]); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it(`should resolve itself promise ${pathToIt[2]} and accept a resolveContext argument`, async () => { const resolveContext = {}; const filename = await resolve.promise( {}, pathToIt[0], pathToIt[1], resolveContext, ); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); } it("should reject on unresolvable requests", async () => { await assert.rejects( new Promise( /** * @param {(value: void) => void} res resolve * @param {(reason?: Error) => void} rej reject */ (res, rej) => { resolve(__dirname, "this-module-should-not-exist", (err) => { if (err) return rej(err); res(); }); }, ), /Can't resolve/, ); }); it("should reject on unresolvable requests sync", () => { assert.throws( () => resolve.sync(__dirname, "this-module-should-not-exist"), /Can't resolve/, ); }); it("should reject on unresolvable requests promise", async () => { await assert.rejects( resolve.promise(__dirname, "this-module-should-not-exist"), /Can't resolve/, ); }); it("should create a async resolver", (t, done) => { const myResolve = resolve.create({ extensions: [".js", ".json", ".node"], }); myResolve(__dirname, "../lib/index", (err, filename) => { if (err) { done(err); return; } assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it("should create a async resolver and accepting context", (t, done) => { const myResolve = resolve.create({ extensions: [".js", ".json", ".node"], }); myResolve({}, __dirname, "../lib/index", (err, filename) => { if (err) { done(err); return; } assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it("should create a async resolver and throw an error on unresolvable request", async () => { const myResolve = resolve.create({ extensions: [".js"], }); await assert.rejects( new Promise( /** * @param {(value: void) => void} res resolve * @param {(reason?: Error) => void} rej reject */ (res, rej) => { myResolve(__dirname, "this-module-should-not-exist", (err) => { if (err) return rej(err); res(); }); }, ), /Can't resolve/, ); }); it("should create a sync resolver", () => { const myResolve = resolve.create.sync({ extensions: [".js", ".json", ".node"], }); const filename = myResolve(__dirname, "../lib/index"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should create a sync resolver and accepting context", () => { const myResolve = resolve.create.sync({ extensions: [".js", ".json", ".node"], }); const filename = myResolve({}, __dirname, "../lib/index"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should create a sync resolver and throw an error on unresolvable request", () => { const myResolve = resolve.create.sync({ extensions: [".js"], }); assert.throws( () => myResolve(__dirname, "this-module-should-not-exist"), /Can't resolve/, ); }); it("should create a promise resolver", async () => { const myResolve = resolve.create.promise({ extensions: [".js", ".json", ".node"], }); const filename = await myResolve(__dirname, "../lib/index"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should create a promise resolver and accepting context", async () => { const myResolve = resolve.create.promise({ extensions: [".js", ".json", ".node"], }); const filename = await myResolve({}, __dirname, "../lib/index"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should create a promise resolver and return rejected promise on unresolvable request", async () => { const myResolve = resolve.create.promise({ extensions: [".js"], }); await assert.rejects( myResolve(__dirname, "this-module-should-not-exist"), /Can't resolve/, ); }); it("should resolve via the Resolver.resolve method", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); resolver.resolve(__dirname, "../lib/index", (err, filename) => { if (err) { done(err); return; } assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it("should resolve via the Resolver.resolve method with resolve context", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); resolver.resolve(__dirname, "../lib/index", {}, (err, filename) => { if (err) { done(err); return; } assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it("should resolve via the Resolver.resolve method with context", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); resolver.resolve({}, __dirname, "../lib/index", (err, filename) => { if (err) { done(err); return; } assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it("should resolve via the Resolver.resolve method with context and resolve context", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); resolver.resolve({}, __dirname, "../lib/index", {}, (err, filename) => { if (err) { done(err); return; } assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); done(); }); }); it("should resolve via the Resolver.resolveSync method", () => { const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = resolver.resolveSync(__dirname, "../lib/index"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should resolve via the Resolver.resolveSync method with resolve context", () => { const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = resolver.resolveSync(__dirname, "../lib/index", {}); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should resolve via the Resolver.resolveSync method with context", () => { const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = resolver.resolveSync({}, __dirname, "../lib/index"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should resolve via the Resolver.resolveSync method with context and resolve context", () => { const resolver = ResolverFactory.createResolver({ useSyncFileSystemCalls: true, fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = resolver.resolveSync({}, __dirname, "../lib/index", {}); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should resolve via the Resolver.resolvePromise method", async () => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = await resolver.resolvePromise(__dirname, "../lib/index"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should resolve via the Resolver.resolvePromise method with resolve context", async () => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = await resolver.resolvePromise( __dirname, "../lib/index", {}, ); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should resolve via the Resolver.resolvePromise method with context", async () => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = await resolver.resolvePromise( {}, __dirname, "../lib/index", ); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); it("should resolve via the Resolver.resolvePromise method with context and resolve context", async () => { const resolver = ResolverFactory.createResolver({ fileSystem: new CachedInputFileSystem(fs, 4000), extensions: [".js", ".json", ".node"], }); const filename = await resolver.resolvePromise( {}, __dirname, "../lib/index", ); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); }); describe("API", () => { const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const resolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], }); it("getHook returns the wrapped hook for 'before*' names", () => { const hook = resolver.getHook("beforeResolve"); assert.strictEqual(typeof hook.tapAsync, "function"); }); it("getHook returns the wrapped hook for 'after*' names", () => { const hook = resolver.getHook("afterResolve"); assert.strictEqual(typeof hook.tapAsync, "function"); }); it("getHook throws on an unknown hook name", () => { assert.throws( () => resolver.getHook("doesNotExist"), (err) => err instanceof Error && err.message.includes("Hook doesNotExist doesn't exist"), ); }); it("getHook returns the given hook instance as-is", () => { const hook = resolver.hooks.resolve; assert.strictEqual(resolver.getHook(hook), hook); }); it("ensureHook creates a hook when it does not exist", () => { const hook = resolver.ensureHook("customCreatedHook"); assert.strictEqual(typeof hook.tapAsync, "function"); // Calling again should return the same hook. const hook2 = resolver.ensureHook("customCreatedHook"); assert.strictEqual(hook2, hook); }); it("ensureHook wraps 'before*' and 'after*' names", () => { assert.strictEqual( typeof resolver.ensureHook("beforeAnotherHook").tapAsync, "function", ); assert.strictEqual( typeof resolver.ensureHook("afterAnotherHook").tapAsync, "function", ); }); it("isModule recognizes module paths", () => { assert.strictEqual(resolver.isModule("foo"), true); assert.strictEqual(resolver.isModule("./foo"), false); assert.strictEqual(resolver.isModule("/foo"), false); }); it("isPrivate recognizes internal paths", () => { assert.strictEqual(resolver.isPrivate("#foo"), true); assert.strictEqual(resolver.isPrivate("./foo"), false); }); it("isDirectory recognizes paths ending in /", () => { assert.strictEqual(resolver.isDirectory("/foo/"), true); assert.strictEqual(resolver.isDirectory("/foo"), false); }); it("join and normalize delegate to util/path", () => { assert.strictEqual(resolver.join("/a", "b"), "/a/b"); assert.strictEqual(resolver.normalize("/a/./b"), "/a/b"); }); it("throws when resolveSync is used on a non-synchronous filesystem", () => { const asyncResolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], }); assert.throws( () => asyncResolver.resolveSync({}, fixtures, "./a"), (err) => err instanceof Error && err.message.includes( "Cannot 'resolveSync' because the fileSystem is not sync. Use 'resolve'!", ), ); }); it("resolves when context is omitted", (t, done) => { resolver.resolve(fixtures, "./a", (err, result) => { if (err) return done(err); assert.strictEqual(typeof result, "string"); done(); }); }); it("resolves when context is omitted (with resolveContext)", (t, done) => { resolver.resolve(fixtures, "./a", {}, (err, result) => { if (err) return done(err); assert.strictEqual(typeof result, "string"); done(); }); }); it("reports an error when the path argument is not a string", (t, done) => { resolver.resolve( {}, // @ts-expect-error for tests 123, "./a", {}, (err) => { assert.ok(err instanceof Error); assert.ok(err.message.includes("path argument is not a string")); done(); }, ); }); it("reports an error when the request argument is not a string", (t, done) => { resolver.resolve( {}, fixtures, // @ts-expect-error for tests null, {}, (err) => { assert.ok(err instanceof Error); assert.ok(err.message.includes("request argument is not a string")); done(); }, ); }); it("resolves when resolveContext is omitted", (t, done) => { resolver.resolve({}, fixtures, "./a", (err, result) => { if (err) return done(err); assert.strictEqual(typeof result, "string"); done(); }); }); it("resolves when resolveContext is null", (t, done) => { resolver.resolve( {}, fixtures, "./a", // @ts-expect-error for tests null, (err, result) => { if (err) return done(err); assert.strictEqual(typeof result, "string"); done(); }, ); }); it("throws when callback is not a function", () => { assert.throws( () => { // @ts-expect-error for tests resolver.resolve({}, fixtures, "./a", {}); }, (err) => err instanceof Error && err.message.includes("callback argument is not a function"), ); }); it("invokes the noResolve hook on resolution failure", (t, done) => { const customResolver = ResolverFactory.createResolver({ fileSystem: nodeFileSystem, extensions: [".js"], }); const failed = []; customResolver.hooks.noResolve.tap("Test", (request, err) => { failed.push({ request, err }); }); customResolver.resolve({}, fixtures, "./does-not-exist", {}, (err) => { assert.ok(err); assert.strictEqual(failed.length, 1); assert.strictEqual(failed[0].err, err); done(); }); }); it("populates error.details when a resolve fails", (t, done) => { resolver.resolve({}, fixtures, "./does-not-exist", {}, (err) => { assert.ok(err instanceof Error); assert.notStrictEqual( /** @type {Error & { details?: string }} */ (err).details, undefined, ); done(); }); }); it("populates error.details when a resolve fails and log is present", (t, done) => { const log = []; resolver.resolve( {}, fixtures, "./does-not-exist", { log: (m) => log.push(m) }, (err) => { assert.ok(err instanceof Error); assert.notStrictEqual( /** @type {Error & { details?: string }} */ (err).details, undefined, ); assert.ok(log.length > 0); done(); }, ); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/smoke/000077500000000000000000000000001523262174200212325ustar00rootroot00000000000000webpack-enhanced-resolve-7dfc9bc/test/smoke/browser-entry.cjs000066400000000000000000000116111523262174200245550ustar00rootroot00000000000000"use strict"; // Browser entry used by browser-run.cjs and the browser CI job. It builds an // in-memory *asynchronous* file system — the realistic browser model, since // browsers have no synchronous file I/O (a real FS would be backed by fetch, // the File System Access API or IndexedDB) — and resolves a few requests with // the async resolver and only web globals (no Node `fs`). The outcome promise // is exposed on // `globalThis.__SMOKE_RESULT` for the bundle runner to await and assert on. // Use the public entry so the bundle exercises the default-resolver path: in a // browser the `graceful-fs` default is shimmed out (no Node `fs`), and a custom // `fileSystem` is supplied to `create()`. const enhancedResolve = require("../../lib/index"); /** * @param {Record} fileMap absolute path -> file contents * @returns {object} a minimal asynchronous file system */ function createMemoryAsyncFs(fileMap) { const files = new Map(Object.entries(fileMap)); const dirs = new Set(["/"]); for (const filePath of files.keys()) { let dir = filePath; let idx = dir.lastIndexOf("/"); while (idx > 0) { dir = dir.slice(0, idx); dirs.add(dir); idx = dir.lastIndexOf("/"); } } /** * @param {boolean} isFile is a file * @returns {object} a Stats-like object */ const makeStats = (isFile) => ({ isFile: () => isFile, isDirectory: () => !isFile, isSymbolicLink: () => false, isBlockDevice: () => false, isCharacterDevice: () => false, isFIFO: () => false, isSocket: () => false, }); /** * @param {string} pth path * @param {string} code error code * @returns {Error} an errno error */ const fsError = (pth, code) => { const err = /** @type {NodeJS.ErrnoException} */ (new Error(`${code}: ${pth}`)); err.code = code; err.path = pth; return err; }; const statImpl = (pth) => { if (files.has(pth)) return makeStats(true); if (dirs.has(pth)) return makeStats(false); throw fsError(pth, "ENOENT"); }; const readFileImpl = (pth) => { if (!files.has(pth)) throw fsError(pth, "ENOENT"); // Return Uint8Array (not a Node Buffer) to mirror a browser FS and // exercise the runtime-agnostic decode path in lib/util/fs.js. return new TextEncoder().encode(/** @type {string} */ (files.get(pth))); }; const readdirImpl = (pth) => { const prefix = pth === "/" ? "/" : `${pth}/`; const names = new Set(); for (const entry of [...files.keys(), ...dirs]) { if (entry.startsWith(prefix) && entry !== pth) { const [seg] = entry.slice(prefix.length).split("/"); if (seg) names.add(seg); } } return [...names]; }; const readlinkImpl = (pth) => { // Nothing is a symlink in this FS. throw fsError(pth, "EINVAL"); }; // Wrap a synchronous implementation as an async, callback-style fs method // that resolves on a microtask — like a real async browser file system. const toAsync = (impl) => (arg, options, callback) => { const cb = typeof options === "function" ? options : callback; Promise.resolve().then(() => { let result; try { result = impl(String(arg)); } catch (err) { cb(err); return; } cb(null, result); }); }; return { stat: toAsync(statImpl), lstat: toAsync(statImpl), readFile: toAsync(readFileImpl), readdir: toAsync(readdirImpl), readlink: toAsync(readlinkImpl), realpath: toAsync((pth) => pth), }; } const fileSystem = createMemoryAsyncFs({ "/app/index.js": "", "/app/src/a.js": "", "/app/src/sub/b.js": "", "/app/node_modules/pkg/package.json": JSON.stringify({ name: "pkg", main: "lib/main.js", exports: { ".": "./lib/main.js", "./feature": "./lib/feature.js" }, }), "/app/node_modules/pkg/lib/main.js": "", "/app/node_modules/pkg/lib/feature.js": "", }); const doResolve = enhancedResolve.create({ extensions: [".js", ".json"], conditionNames: ["node", "import"], // @ts-expect-error minimal structural file system for the browser smoke fileSystem, }); /** @type {[string, string, string][]} */ const cases = [ ["/app", "./src/a.js", "/app/src/a.js"], ["/app", "./src/a", "/app/src/a.js"], ["/app/src/sub", "../a", "/app/src/a.js"], ["/app", "pkg", "/app/node_modules/pkg/lib/main.js"], ["/app", "pkg/feature", "/app/node_modules/pkg/lib/feature.js"], ]; /** * @param {string} context base directory * @param {string} request request to resolve * @returns {Promise} the resolved path, or a THREW: message */ const resolveAsync = (context, request) => new Promise((resolve) => { doResolve({}, context, request, {}, (err, result) => { resolve(err ? `THREW: ${err.message}` : /** @type {string} */ (result)); }); }); globalThis.__SMOKE_RESULT = (async () => { const results = []; let ok = true; for (const [context, request, expected] of cases) { const actual = await resolveAsync(context, request); const pass = actual === expected; if (!pass) ok = false; results.push({ request, expected, actual, pass }); } return { ok, results }; })(); webpack-enhanced-resolve-7dfc9bc/test/smoke/browser-playwright.cjs000066400000000000000000000051641523262174200256140ustar00rootroot00000000000000"use strict"; // Bundles browser-entry.cjs for the browser with webpack and runs it in real // headless Chromium via Playwright — the authoritative browser check. webpack // resolves the package `browser` field and fails on any Node builtin that is // not shimmed; Chromium then runs the bundle with genuine web APIs only and the // resolutions are asserted via `window.__SMOKE_RESULT`. // // Playwright (and its Chromium) are installed by the CI job, not committed as a // dependency. This script is intended to run there; see the browser job in // .github/workflows/cross-runtime.yml. const assert = require("assert"); const fs = require("fs"); const os = require("os"); const path = require("path"); // eslint-disable-next-line import/no-unresolved const { chromium } = require("playwright"); const webpack = require("webpack"); const entry = path.resolve(__dirname, "browser-entry.cjs"); const outDir = fs.mkdtempSync(path.join(os.tmpdir(), "er-chromium-")); const outFile = "bundle.js"; /** @returns {Promise} the bundled browser script (classic IIFE) */ function bundle() { return new Promise((resolve, reject) => { webpack( { mode: "none", target: "web", entry, output: { path: outDir, filename: outFile }, optimization: { minimize: false }, }, (err, stats) => { if (err) return reject(err); if (stats && stats.hasErrors()) { return reject( new Error(stats.toString({ all: false, errors: true })), ); } resolve(fs.readFileSync(path.join(outDir, outFile), "utf8")); }, ); }); } /** * Bundle the entry, drive it in a headless Chromium page and surface the * sandbox result through this process's exit code. * @returns {Promise} resolves on success, rejects on smoke failure */ async function main() { const code = await bundle(); const browser = await chromium.launch(); try { const page = await browser.newPage(); await page.setContent(""); await page.addScriptTag({ content: code }); const result = await page.evaluate( // The entry assigns a promise to globalThis.__SMOKE_RESULT. () => globalThis.__SMOKE_RESULT, ); assert(result, "bundle did not set __SMOKE_RESULT"); for (const r of result.results) { assert( r.pass, `resolve(${r.request}) => ${String(r.actual)}, expected ${r.expected}`, ); } assert(result.ok, "one or more resolutions failed in Chromium"); console.log( `browser smoke: all ${result.results.length} resolutions passed in headless Chromium`, ); } finally { await browser.close(); } } main().catch((err) => { console.error(err); process.exitCode = 1; }); webpack-enhanced-resolve-7dfc9bc/test/smoke/browser-run.cjs000066400000000000000000000065321523262174200242260ustar00rootroot00000000000000"use strict"; // Bundles browser-entry.cjs for the browser with webpack as an ECMAScript // module (experiments.outputModule), then runs the ESM bundle inside a `vm` // sandbox that exposes only browser-style globals — no `require`, `process`, // `Buffer`, `module` or Node `fs`. For the web target webpack resolves the // package `browser` field (the path/process/module shims) and errors on any // Node builtin that is not shimmed, so a successful build plus a successful run // proves the resolver works with nothing but standard web globals. // // Requires Node's --experimental-vm-modules flag (see the test:browser script). const assert = require("assert"); const fs = require("fs"); const os = require("os"); const path = require("path"); const vm = require("vm"); const webpack = require("webpack"); const entry = path.resolve(__dirname, "browser-entry.cjs"); const outDir = fs.mkdtempSync(path.join(os.tmpdir(), "er-browser-")); const outFile = "bundle.mjs"; /** @returns {Promise} the bundled ESM source */ function bundle() { return new Promise((resolve, reject) => { webpack( { mode: "none", target: "web", entry, experiments: { outputModule: true }, output: { path: outDir, filename: outFile, module: true, library: { type: "module" }, chunkFormat: "module", publicPath: "", }, optimization: { minimize: false }, }, (err, stats) => { if (err) return reject(err); if (stats && stats.hasErrors()) { return reject( new Error(stats.toString({ all: false, errors: true })), ); } resolve(fs.readFileSync(path.join(outDir, outFile), "utf8")); }, ); }); } /** * Bundle the entry, execute it in the web-globals VM sandbox and surface * the sandbox result through this process's exit code. * @returns {Promise} resolves on success, rejects on smoke failure */ async function main() { const code = await bundle(); // A deliberately minimal, browser-like global set. Notably absent: require, // process, Buffer, module, global, __dirname, and any Node builtin. const sandbox = { globalThis: undefined, console, URL, URLSearchParams, TextEncoder, TextDecoder, Uint8Array, ArrayBuffer, Map, Set, Promise, Date, JSON, Math, Object, Array, String, Number, Boolean, RegExp, Error, TypeError, Symbol, WeakMap, WeakSet, Reflect, Proxy, }; sandbox.globalThis = sandbox; vm.createContext(sandbox); const mod = new vm.SourceTextModule(code, { context: sandbox, initializeImportMeta: (meta) => { meta.url = "https://example.test/bundle.mjs"; }, }); await mod.link(() => { throw new Error("the bundle should be self-contained (no imports)"); }); await mod.evaluate(); // The entry resolves asynchronously (realistic browser FS), so this is a // promise to await — not a plain value. const result = await sandbox.__SMOKE_RESULT; assert(result, "bundle did not set __SMOKE_RESULT"); for (const r of result.results) { assert( r.pass, `resolve(${r.request}) => ${String(r.actual)}, expected ${r.expected}`, ); } assert(result.ok, "one or more resolutions failed in the browser sandbox"); console.log( `browser smoke: all ${result.results.length} resolutions passed in a Node-global-free sandbox (webpack ESM bundle)`, ); } main().catch((err) => { console.error(err); process.exitCode = 1; }); webpack-enhanced-resolve-7dfc9bc/test/strip-json-comments.test.js000066400000000000000000000061001523262174200253600ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const stripJsonComments = require("../lib/util/strip-json-comments"); const { describe, it } = require("./_runner"); /* eslint-disable jsdoc/reject-any-type */ describe("util/strip-json-comments", () => { it("throws when given a non-string", () => { assert.throws(() => stripJsonComments(/** @type {any} */ (42)), TypeError); }); it("removes single-line comments (default: replace with whitespace)", () => { const input = '{"a": 1} // comment'; const result = stripJsonComments(input); assert.strictEqual(result.length, input.length); assert.strictEqual(result.trim(), '{"a": 1}'); }); it("removes single-line comments without whitespace when whitespace:false", () => { const result = stripJsonComments('{"a": 1} // comment', { whitespace: false, }); assert.strictEqual(result, '{"a": 1} '); }); it("handles single-line comments terminated by \\r\\n", () => { const result = stripJsonComments('{"a": 1} // c\r\n"b"'); assert.strictEqual(result, '{"a": 1} \r\n"b"'); }); it("handles single-line comments terminated by \\n", () => { const input = '{"a": 1} // c\n"b"'; const result = stripJsonComments(input); assert.strictEqual(result.length, input.length); assert.ok(result.includes("\n")); assert.ok(result.includes('"b"')); }); it("removes multi-line comments", () => { const input = '{"a": 1} /* a\nb */ "c"'; const result = stripJsonComments(input); assert.strictEqual(result.length, input.length); assert.ok(result.includes('"c"')); assert.ok(!result.includes("/*")); }); it("does not remove comments inside strings", () => { const result = stripJsonComments('{"a": "// not a comment"}'); assert.strictEqual(result, '{"a": "// not a comment"}'); }); it("treats escaped quotes correctly", () => { const result = stripJsonComments('{"a": "x\\"//y"} // c'); assert.strictEqual(result, '{"a": "x\\"//y"} '); }); it("strips trailing commas when trailingCommas:true", () => { const result = stripJsonComments('{"a": 1,}', { trailingCommas: true }); assert.strictEqual(result, '{"a": 1 }'); }); it("keeps non-trailing commas when trailingCommas:true", () => { const result = stripJsonComments('{"a": 1, "b": 2}', { trailingCommas: true, }); assert.strictEqual(result, '{"a": 1, "b": 2}'); }); it("strips trailing commas before ]", () => { const result = stripJsonComments("[1, 2, 3,]", { trailingCommas: true }); assert.strictEqual(result, "[1, 2, 3 ]"); }); it("handles an unterminated multiline comment at end of input", () => { const result = stripJsonComments('{"a": 1} /* unterminated'); // Multiline comments without closing */ are not stripped assert.strictEqual(result, '{"a": 1} /* unterminated'); }); it("parses valid JSONC into valid JSON", () => { const jsonc = '{\n\t// a comment\n\t"a": 1, /* nested */\n\t"b": [1, 2,],\n}'; const cleaned = stripJsonComments(jsonc, { trailingCommas: true, whitespace: true, }); assert.doesNotThrow(() => JSON.parse(cleaned)); assert.deepStrictEqual(JSON.parse(cleaned), { a: 1, b: [1, 2] }); }); }); webpack-enhanced-resolve-7dfc9bc/test/symlink.test.js000066400000000000000000000151401523262174200231170ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const { platform } = require("os"); const path = require("path"); const resolve = require("../"); const { afterEach, beforeEach, describe, it } = require("./_runner"); const tempPath = path.join(__dirname, "temp"); describe("symlink", () => { let isAdmin = true; try { fs.mkdirSync(tempPath); fs.symlinkSync( path.join(__dirname, "..", "lib", "index.js"), path.join(tempPath, "test"), "file", ); fs.symlinkSync( path.join(__dirname, "..", "lib"), path.join(tempPath, "test2"), "dir", ); } catch (_err) { isAdmin = false; } try { fs.unlinkSync(path.join(tempPath, "test")); } catch (_err) { isAdmin = false; } try { fs.unlinkSync(path.join(tempPath, "test2")); } catch (_err) { isAdmin = false; } try { fs.rmdirSync(tempPath); } catch (_err) { isAdmin = false; } if (isAdmin) { // PR #150: Detect Windows and preserve current working directory. const isWindows = platform() === "win32"; const oldCWD = (isWindows && process.cwd()) || ""; beforeEach(() => { // Create some cool symlinks try { fs.mkdirSync(tempPath); fs.symlinkSync( path.join(__dirname, "..", "lib", "index.js"), path.join(tempPath, "index.js"), "file", ); fs.symlinkSync( path.join(__dirname, "..", "lib"), path.join(tempPath, "lib"), "dir", ); fs.symlinkSync( path.join(__dirname, ".."), path.join(tempPath, "this"), "dir", ); fs.symlinkSync( path.join(tempPath, "this"), path.join(tempPath, "that"), "dir", ); fs.symlinkSync( path.join("..", "..", "lib", "index.js"), path.join(tempPath, "node.relative.js"), "file", ); fs.symlinkSync( path.join(".", "node.relative.js"), path.join(tempPath, "node.relative.sym.js"), "file", ); // PR #150: Set the current working directory so that tests will fail if changes get reverted. if (isWindows) { process.chdir(path.join(tempPath, "that")); } } catch (_err) { // ignore the failure } }); afterEach(() => { // PR #150: Restore the original working directory. if (isWindows) { process.chdir(oldCWD); } fs.unlinkSync(path.join(tempPath, "index.js")); fs.unlinkSync(path.join(tempPath, "node.relative.js")); fs.unlinkSync(path.join(tempPath, "node.relative.sym.js")); fs.unlinkSync(path.join(tempPath, "lib")); fs.unlinkSync(path.join(tempPath, "this")); fs.unlinkSync(path.join(tempPath, "that")); fs.rmdirSync(tempPath); }); const resolveWithoutSymlinks = resolve.create({ symlinks: false, }); const resolveSyncWithoutSymlinks = resolve.create.sync({ symlinks: false, }); for (const pathToIt of [ [tempPath, "./index.js", "with a symlink to a file"], [tempPath, "./node.relative.js", "with a relative symlink to a file"], [ tempPath, "./node.relative.sym.js", "with a relative symlink to a symlink to a file", ], [tempPath, "./lib/index.js", "with a symlink to a directory 1"], [tempPath, "./this/lib/index.js", "with a symlink to a directory 2"], [ tempPath, "./this/test/temp/index.js", "with multiple symlinks in the path 1", ], [ tempPath, "./this/test/temp/lib/index.js", "with multiple symlinks in the path 2", ], [ tempPath, "./this/test/temp/this/lib/index.js", "with multiple symlinks in the path 3", ], [ tempPath, "./that/lib/index.js", "with a symlink to a directory 2 (chained)", ], [ tempPath, "./that/test/temp/index.js", "with multiple symlinks in the path 1 (chained)", ], [ tempPath, "./that/test/temp/lib/index.js", "with multiple symlinks in the path 2 (chained)", ], [ tempPath, "./that/test/temp/that/lib/index.js", "with multiple symlinks in the path 3 (chained)", ], [ path.join(tempPath, "lib"), "./index.js", "with symlinked directory as context 1", ], [ path.join(tempPath, "this"), "./lib/index.js", "with symlinked directory as context 2", ], [ path.join(tempPath, "this"), "./test/temp/lib/index.js", "with symlinked directory as context and in path", ], [ path.join(tempPath, "this", "lib"), "./index.js", "with symlinked directory in context path", ], [ path.join(tempPath, "this", "test"), "./temp/index.js", "with symlinked directory in context path and symlinked file", ], [ path.join(tempPath, "this", "test"), "./temp/lib/index.js", "with symlinked directory in context path and symlinked directory", ], [ path.join(tempPath, "that"), "./lib/index.js", "with symlinked directory as context 2 (chained)", ], [ path.join(tempPath, "that"), "./test/temp/lib/index.js", "with symlinked directory as context and in path (chained)", ], [ path.join(tempPath, "that", "lib"), "./index.js", "with symlinked directory in context path (chained)", ], [ path.join(tempPath, "that", "test"), "./temp/index.js", "with symlinked directory in context path and symlinked file (chained)", ], [ path.join(tempPath, "that", "test"), "./temp/lib/index.js", "with symlinked directory in context path and symlinked directory (chained)", ], ]) { it(`should resolve symlink to itself ${pathToIt[2]}`, (t, done) => { resolve(pathToIt[0], pathToIt[1], (err, filename) => { if (err) return done(err); assert.notStrictEqual(filename, undefined); assert.strictEqual(typeof filename, "string"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); resolveWithoutSymlinks(pathToIt[0], pathToIt[1], (err, filename) => { if (err) return done(err); assert.strictEqual(typeof filename, "string"); assert.deepStrictEqual( filename, path.resolve(pathToIt[0], pathToIt[1]), ); done(); }); }); }); it(`should resolve symlink to itself sync ${pathToIt[2]}`, () => { let filename = resolve.sync(pathToIt[0], pathToIt[1]); assert.notStrictEqual(filename, undefined); assert.strictEqual(typeof filename, "string"); assert.deepStrictEqual( filename, path.join(__dirname, "..", "lib", "index.js"), ); filename = resolveSyncWithoutSymlinks(pathToIt[0], pathToIt[1]); assert.strictEqual(typeof filename, "string"); assert.deepStrictEqual( filename, path.resolve(pathToIt[0], pathToIt[1]), ); }); } } else { it("cannot test symlinks because we have no permission to create them", () => { // Nothing }); } }); webpack-enhanced-resolve-7dfc9bc/test/tsconfig-paths.test.js000066400000000000000000001425601523262174200243710ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { ResolverFactory } = require("../"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const { describe, it } = require("./_runner"); const fileSystem = new CachedInputFileSystem(fs, 4000); const baseExampleDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "base", ); const extendsExampleDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-base", ); const extendsNpmDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-npm", ); const extendsCircularDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-circular", ); const referencesProjectDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "references-project", ); const referencesCircularDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "references-circular", ); const extendsUnscopedPkgDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-unscoped-pkg", ); const extendsNpmWorkspaceDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-npm-workspace", ); describe("TsconfigPathsPlugin", () => { it("resolves exact mapped path '@components/*' via tsconfig option (example)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, baseExampleDir, "@components/button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "components", "button.ts"), ); done(); }, ); }); it("when multiple patterns match a module specifier, the pattern with the longest matching prefix before any * token is used:", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), }); resolver.resolve({}, baseExampleDir, "longest/bar", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "mapped", "longest", "three.ts"), ); resolver.resolve({}, baseExampleDir, "longest/bar", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "mapped", "longest", "three.ts"), ); done(); }); }); }); it("resolves exact mapped path 'foo' via tsconfig option (example)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve({}, baseExampleDir, "foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "mapped", "foo", "index.ts"), ); done(); }); }); it("resolves wildcard mapped path 'bar/*' via tsconfig option (example)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve({}, baseExampleDir, "bar/file1", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "mapped", "bar", "file1.ts"), ); done(); }); }); it("resolves wildcard mapped path '*/old-file' to specific file via tsconfig option (example)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, baseExampleDir, "utils/old-file", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "components", "new-file.ts"), ); done(); }, ); }); it("falls through when no mapping exists (example)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, baseExampleDir, "does-not-exist", {}, (err, result) => { assert.ok(err instanceof Error); assert.strictEqual(result, undefined); done(); }, ); }); it("resolves synchronously via resolveSync when useSyncFileSystemCalls is set", () => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); assert.strictEqual( resolver.resolveSync({}, baseExampleDir, "@components/button"), path.join(baseExampleDir, "src", "components", "button.ts"), ); assert.strictEqual( resolver.resolveSync({}, baseExampleDir, "bar/file1"), path.join(baseExampleDir, "src", "mapped", "bar", "file1.ts"), ); assert.throws(() => { resolver.resolveSync({}, baseExampleDir, "does-not-exist"); }, /Can't resolve 'does-not-exist'/); }); it("resolveSync surfaces missing-tsconfig errors instead of fileSystem-not-sync", () => { const resolver = ResolverFactory.createResolver({ fileSystem, tsconfig: true, useSyncFileSystemCalls: true, }); assert.throws(() => { resolver.resolveSync(process.cwd(), "test"); }, /Can't resolve 'test'/); }); it("resolves '@components/*' using extends from extendsExampleDir project", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(extendsExampleDir, "tsconfig.json"), }); resolver.resolve( {}, extendsExampleDir, "@components/button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(extendsExampleDir, "src", "components", "button.ts"), ); done(); }, ); }); it("resolves '@utils/*' using extends from extendsExampleDir project", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: true, }); resolver.resolve( {}, extendsExampleDir, "@utils/date", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(extendsExampleDir, "src", "utils", "date.ts"), ); done(); }, ); }); describe("Path wildcard patterns", () => { it("resolves 'foo/*' wildcard pattern", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), }); resolver.resolve({}, baseExampleDir, "foo/file1", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result for foo")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "mapped", "bar", "file1.ts"), ); done(); }); }); it("resolves '*' catch-all pattern to src/mapped/star/*", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, baseExampleDir, "star-bar/index", {}, (err, resultStar) => { if (err) return done(err); if (!resultStar) return done(new Error("No result for star/*")); assert.deepStrictEqual( resultStar, path.join( baseExampleDir, "src", "mapped", "star", "star-bar", "index.ts", ), ); done(); }, ); }); it("resolves package with mainFields", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, baseExampleDir, "main-field-package", {}, (err, result) => { if (err) return done(err); if (!result) { return done(new Error("No result for main-field-package")); } assert.deepStrictEqual( result, path.join( baseExampleDir, "src", "mapped", "star", "main-field-package", "node.ts", ), ); done(); }, ); }); it("resolves package with browser field", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, baseExampleDir, "browser-field-package", {}, (err, result) => { if (err) return done(err); if (!result) { return done(new Error("No result for browser-field-package")); } assert.deepStrictEqual( result, path.join( baseExampleDir, "src", "mapped", "star", "browser-field-package", "browser.ts", ), ); done(); }, ); }); it("resolves package with default index.ts", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, baseExampleDir, "no-main-field-package", {}, (err, result) => { if (err) return done(err); if (!result) { return done(new Error("No result for no-main-field-package")); } assert.deepStrictEqual( result, path.join( baseExampleDir, "src", "mapped", "star", "no-main-field-package", "index.ts", ), ); done(); }, ); }); }); it("should resolve paths when extending from npm package (node_modules)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(extendsNpmDir, "tsconfig.json"), }); // Should resolve @components/* from the extended npm package config resolver.resolve( {}, extendsNpmDir, "@components/button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); // Should resolve to utils or components based on the paths in react/tsconfig.json assert.match(result, /src[\\/](utils|components)[\\/]button\.ts$/); done(); }, ); }); it("should handle malformed tsconfig.json gracefully", (t, done) => { const malformedExampleDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "malformed-json", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(malformedExampleDir, "tsconfig.json"), }); // Should fail to resolve because the malformed tsconfig should be ignored resolver.resolve( {}, malformedExampleDir, "@components/button", {}, (err, result) => { assert.ok(err instanceof Error); assert.strictEqual(result, undefined); done(); }, ); }); // eslint-disable-next-line no-template-curly-in-string describe("${configDir} template variable support", () => { // eslint-disable-next-line no-template-curly-in-string it("should substitute ${configDir} in path mappings", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), }); // The base tsconfig.json now uses ${configDir}/src/components/* resolver.resolve( {}, baseExampleDir, "@components/button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "components", "button.ts"), ); done(); }, ); }); // eslint-disable-next-line no-template-curly-in-string it("should substitute ${configDir} in multiple path patterns", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(baseExampleDir, "tsconfig.json"), }); // Test @utils/* pattern resolver.resolve({}, baseExampleDir, "@utils/date", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "utils", "date.ts"), ); // Test exact pattern 'foo' resolver.resolve({}, baseExampleDir, "foo", {}, (err2, result2) => { if (err2) return done(err2); if (!result2) return done(new Error("No result for foo")); assert.deepStrictEqual( result2, path.join(baseExampleDir, "src", "mapped", "foo", "index.ts"), ); done(); }); }); }); // eslint-disable-next-line no-template-curly-in-string it("should substitute ${configDir} in referenced projects", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // app's tsconfig uses ${configDir}/src/* resolver.resolve({}, appDir, "@app/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.join(appDir, "src", "index.ts")); done(); }); }); // eslint-disable-next-line no-template-curly-in-string it("should substitute ${configDir} in extends field", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(extendsExampleDir, "tsconfig.json"), }); // extendsExampleDir uses ${configDir}/../base/tsconfig in extends resolver.resolve( {}, extendsExampleDir, "@components/button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(extendsExampleDir, "src", "components", "button.ts"), ); done(); }, ); }); it("should handle circular extends without hanging", (t, done) => { const aDir = path.join(extendsCircularDir, "a"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(aDir, "tsconfig.json"), }); // a extends b, b extends a - circular. Should break cycle and resolve. resolver.resolve({}, aDir, "@lib/foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.join(aDir, "src", "lib", "foo.ts")); done(); }); }); // eslint-disable-next-line no-template-curly-in-string it("should substitute ${configDir} in references field", (t, done) => { const sharedDir = path.join(referencesProjectDir, "packages", "shared"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(referencesProjectDir, "tsconfig.json"), references: "auto", }, }); // root tsconfig uses ${configDir}/packages/shared in references resolver.resolve({}, sharedDir, "@shared/helper", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(sharedDir, "src", "utils", "helper.ts"), ); done(); }); }); }); it("should override baseUrl from tsconfig with option", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(baseExampleDir, "tsconfig.json"), baseUrl: "./src", // Override baseUrl from tsconfig (which is ".") }, }); resolver.resolve( {}, baseExampleDir, "utils/date", // This should resolve relative to baseExampleDir/src (the overridden baseUrl) {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "utils", "date.ts"), ); done(); }, ); }); it("should use baseUrl from tsconfig when not overridden", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(baseExampleDir, "tsconfig.json"), // baseUrl not specified, should use from tsconfig (which is ".") }, }); // With baseUrl from tsconfig (.), modules should resolve relative to baseExampleDir resolver.resolve( {}, baseExampleDir, "src/utils/date", // This should resolve relative to baseExampleDir (the tsconfig baseUrl) {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "utils", "date.ts"), ); done(); }, ); }); describe("TypeScript Project References", () => { it("should support tsconfig object format with configFile", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(baseExampleDir, "tsconfig.json"), references: "auto", }, }); resolver.resolve( {}, baseExampleDir, "@components/button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(baseExampleDir, "src", "components", "button.ts"), ); done(); }, ); }); it("should resolve own paths (without cross-project references)", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // app's own @app/* paths should work resolver.resolve({}, appDir, "@app/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.join(appDir, "src", "index.ts")); // @shared/* from app context should fail (not in app's paths) resolver.resolve({}, appDir, "@shared/utils/helper", {}, (err2) => { assert.ok(err2 instanceof Error); done(); }); }); }); it("should resolve self-references within a referenced project", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const sharedDir = path.join(referencesProjectDir, "packages", "shared"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // When resolving from sharedDir, @shared/* should work (self-reference) resolver.resolve({}, sharedDir, "@shared/helper", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(sharedDir, "src", "utils", "helper.ts"), ); done(); }); }); it("should support explicit references array", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const sharedSrcDir = path.join( referencesProjectDir, "packages", "shared", "src", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: ["../shared"], }, }); // Self-reference should still work with explicit references resolver.resolve( {}, sharedSrcDir, "@shared/helper", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(sharedSrcDir, "utils", "helper.ts"), ); done(); }, ); }); it("should not load references when references option is omitted", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), // references is not specified - should not load any references }, }); // @shared/* should fail because references are not loaded resolver.resolve({}, appDir, "@shared/utils/helper", {}, (err) => { assert.ok(err instanceof Error); done(); }); }); it("should handle nested references (when a referenced project has its own references)", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const utilsSrcDir = path.join( referencesProjectDir, "packages", "utils", "src", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // utils has @utils/* paths, and shared references utils // When resolving from utils context, @utils/* should work resolver.resolve({}, utilsSrcDir, "@utils/date", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(utilsSrcDir, "core", "date.ts"), ); done(); }); }); describe("modules resolution with references", () => { it("should resolve modules from main project's baseUrl", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // Should resolve relative to app's baseUrl (app root) resolver.resolve( {}, appDir, "src/components/Button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(appDir, "src", "components", "Button.ts"), ); done(); }, ); }); it("should resolve modules from referenced project's baseUrl (self-reference)", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const sharedSrcDir = path.join( referencesProjectDir, "packages", "shared", "src", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // When resolving from shared/src, should use shared's baseUrl (shared/src) // cspell:disable-line resolver.resolve( {}, sharedSrcDir, "utils/helper", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(sharedSrcDir, "utils", "helper.ts"), ); done(); }, ); }); it("should resolve components from referenced project's baseUrl", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const sharedSrcDir = path.join( referencesProjectDir, "packages", "shared", "src", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // Resolve components from shared project's baseUrl resolver.resolve( {}, sharedSrcDir, "components/Input", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(sharedSrcDir, "components", "Input.ts"), ); done(); }, ); }); it("should use correct baseUrl based on request context", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const sharedDir = path.join(referencesProjectDir, "packages", "shared"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: "auto", }, }); // From app context, 'src/index' should resolve to app/src/index resolver.resolve({}, appDir, "src/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result from app")); assert.deepStrictEqual(result, path.join(appDir, "src", "index.ts")); // From shared context, 'utils/helper' should resolve to shared/src/utils/helper resolver.resolve( {}, path.join(sharedDir, "src"), "utils/helper", {}, (err2, result2) => { if (err2) return done(err2); if (!result2) return done(new Error("No result from shared")); assert.deepStrictEqual( result2, path.join(sharedDir, "src", "utils", "helper.ts"), ); done(); }, ); }); }); it("should support explicit references with modules resolution", (t, done) => { const appDir = path.join(referencesProjectDir, "packages", "app"); const sharedSrcDir = path.join( referencesProjectDir, "packages", "shared", "src", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(appDir, "tsconfig.json"), references: ["../shared"], }, }); // Explicit references should also support modules resolution resolver.resolve( {}, sharedSrcDir, "utils/helper", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(sharedSrcDir, "utils", "helper.ts"), ); done(); }, ); }); }); describe("paths are scoped to the containing tsconfig (tsc-aligned)", () => { // Fixture layout: // references-priority/tsconfig.json -> "@lib/*": ["./main-lib/*"], references ./ref // references-priority/main-lib/foo.ts (source = "main") // references-priority/ref/tsconfig.json -> "@lib/*": ["./ref-lib/*"] // references-priority/ref/ref-lib/foo.ts (source = "ref") // // `tsc` resolves `paths` using the tsconfig that owns the importing // file, not by merging across a `references` edge, so each context // must see its own target even though the alias name collides. const referencesPriorityDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "references-priority", ); const refDir = path.join(referencesPriorityDir, "ref"); it("resolves @lib/foo from the main context to main's target", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(referencesPriorityDir, "tsconfig.json"), references: "auto", }, }); resolver.resolve( {}, referencesPriorityDir, "@lib/foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(referencesPriorityDir, "main-lib", "foo.ts"), ); done(); }, ); }); it("resolves @lib/foo from the reference context to the reference's target", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(referencesPriorityDir, "tsconfig.json"), references: "auto", }, }); resolver.resolve({}, refDir, "@lib/foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(refDir, "ref-lib", "foo.ts"), ); done(); }); }); it("reference paths do not leak into a sibling/unrelated main lookup", (t, done) => { // When references are loaded but the request is made from the // main context, the reference's alias target must not win over // the main's target — even if the reference's target also exists. const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(referencesPriorityDir, "tsconfig.json"), references: "auto", }, }); resolver.resolve( {}, referencesPriorityDir, "@lib/foo", {}, (err, result) => { if (err) return done(err); assert.notDeepStrictEqual( result, path.join(refDir, "ref-lib", "foo.ts"), ); done(); }, ); }); }); }); describe("bug: baseUrl from deep extends chain (non-sibling directories)", () => { const deepBaseUrlDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-deep-baseurl", ); it("should resolve paths whose baseUrl comes from a grandparent extends in a non-sibling directory", (t, done) => { const appDir = path.join(deepBaseUrlDir, "packages", "app"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(appDir, "tsconfig.json"), }); resolver.resolve({}, appDir, "@base/utils/format", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join( deepBaseUrlDir, "tsconfig-base", "src", "utils", "format.ts", ), ); done(); }); }); }); describe("bug: scoped npm package in extends field (@scope/name)", () => { const pkgEntryDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-pkg-entry", ); it("should resolve paths inherited from a scoped npm package tsconfig (extends '@my-tsconfig/base')", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(pkgEntryDir, "tsconfig.json"), }); resolver.resolve({}, pkgEntryDir, "@pkg/util", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join( pkgEntryDir, "node_modules", "@my-tsconfig", "base", "src", "util.ts", ), ); done(); }); }); }); it("should not error when tsconfig is true but tsconfig.json does not exist", (t, done) => { const noTsconfigDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "no-tsconfig", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: true, }); // Should resolve normally via standard resolution (no tsconfig paths applied) resolver.resolve({}, noTsconfigDir, "./src/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(noTsconfigDir, "src", "index.ts"), ); done(); }); }); it("should error when tsconfig is an explicit path but the file does not exist", (t, done) => { const noTsconfigDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "no-tsconfig", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(noTsconfigDir, "tsconfig.json"), }); resolver.resolve({}, noTsconfigDir, "./src/index", {}, (err, result) => { try { assert.ok(err); assert.strictEqual( /** @type {NodeJS.ErrnoException} */ (err).code, "ENOENT", ); assert.strictEqual(result, undefined); done(); } catch (err_) { done(err_); } }); }); describe("tsconfig: true should walk up parent directories", () => { const upwardDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "upward-traversal", ); it("should find tsconfig.json in parent directory when resolving from subdirectory", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: true, }); // resolve from src/app/ — tsconfig.json is in upward-traversal/ (parent's parent) resolver.resolve( {}, path.join(upwardDir, "src", "app"), "@utils/helper", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(upwardDir, "src", "utils", "helper.ts"), ); done(); }, ); }); it("should still fall through when no tsconfig.json exists anywhere up", (t, done) => { const noTsconfigDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "no-tsconfig", ); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: true, }); resolver.resolve({}, noTsconfigDir, "./src/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(noTsconfigDir, "src", "index.ts"), ); done(); }); }); }); describe("tsconfig without baseUrl should not add configDir to module search paths", () => { const noBaseUrlDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "no-baseurl-upward", ); it("should resolve node_modules package instead of matching a file at tsconfig root", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".js", ".json"], mainFields: ["main"], mainFiles: ["index"], tsconfig: true, }); // Resolve "package" from subdir/ which has node_modules/package/. // The parent tsconfig.json (without baseUrl) should NOT cause the // tsconfig root to become a module search path — otherwise "package" // would incorrectly match /package.json instead of the real // node_modules/package/index.js. resolver.resolve( {}, path.join(noBaseUrlDir, "subdir"), "package", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join( noBaseUrlDir, "subdir", "node_modules", "package", "index.js", ), ); done(); }, ); }); }); describe("JSONC support (comments in tsconfig.json)", () => { const jsoncExampleDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "jsonc-comments", ); it("should parse tsconfig.json with line comments (//)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(jsoncExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve( {}, jsoncExampleDir, "@components/button", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(jsoncExampleDir, "src", "components", "button.ts"), ); done(); }, ); }); it("should parse tsconfig.json with block comments (/* */)", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(jsoncExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve({}, jsoncExampleDir, "bar/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(jsoncExampleDir, "src", "mapped", "bar", "index.ts"), ); done(); }); }); it("should parse tsconfig.json with mixed comments", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(jsoncExampleDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); resolver.resolve({}, jsoncExampleDir, "foo", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(jsoncExampleDir, "src", "mapped", "foo", "index.ts"), ); done(); }); }); }); describe("bug: circular project references should not cause infinite recursion", () => { it("should handle circular references without hanging or crashing", (t, done) => { const aDir = path.join(referencesCircularDir, "a"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(aDir, "tsconfig.json"), references: "auto", }, }); // a references b, b references a — should not stack overflow resolver.resolve({}, aDir, "@a/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.join(aDir, "src", "index.ts")); done(); }); }); it("should resolve paths from a circular-referenced project", (t, done) => { const aDir = path.join(referencesCircularDir, "a"); const bDir = path.join(referencesCircularDir, "b"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: { configFile: path.join(aDir, "tsconfig.json"), references: "auto", }, }); // From b's context, @b/* should resolve via b's own paths resolver.resolve({}, bDir, "@b/index", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual(result, path.join(bDir, "src", "index.ts")); done(); }); }); }); describe("bug: '@*' pattern should fall through for scoped npm packages (#20944)", () => { const scopedPkgDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "scoped-pkg-fallthrough", ); it("should resolve '@helper' via the '@*' mapping when the mapped path exists", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx", ".js"], mainFields: ["main"], mainFiles: ["index"], tsconfig: path.join(scopedPkgDir, "tsconfig.json"), }); resolver.resolve({}, scopedPkgDir, "@helper", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(scopedPkgDir, "src", "helper", "index.ts"), ); done(); }); }); it("should fall through to node_modules for '@sentry/react' when '@*' mapping does not resolve", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx", ".js"], mainFields: ["main"], mainFiles: ["index"], tsconfig: path.join(scopedPkgDir, "tsconfig.json"), }); resolver.resolve({}, scopedPkgDir, "@sentry/react", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join( scopedPkgDir, "node_modules", "@sentry", "react", "index.js", ), ); done(); }); }); }); describe("bug: unscoped npm package in extends field", () => { it("should resolve paths inherited from an unscoped npm package tsconfig (extends 'my-base-config')", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(extendsUnscopedPkgDir, "tsconfig.json"), }); resolver.resolve( {}, extendsUnscopedPkgDir, "@pkg/util", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join( extendsUnscopedPkgDir, "node_modules", "my-base-config", "src", "util.ts", ), ); done(); }, ); }); }); describe("extends a non-existent dot-prefixed value (not a package specifier)", () => { const missingRelativeDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-missing-relative", ); it("surfaces the load error instead of searching node_modules", () => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(missingRelativeDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); assert.throws(() => { resolver.resolveSync({}, missingRelativeDir, "@x/y"); }); }); }); describe("bug: npm package in extends field hoisted to a parent node_modules (#21457)", () => { it("should resolve a scoped package extends from a parent workspace node_modules", (t, done) => { const appDir = path.join(extendsNpmWorkspaceDir, "packages", "app"); const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(appDir, "tsconfig.json"), }); resolver.resolve({}, appDir, "@pkg/util", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join( extendsNpmWorkspaceDir, "node_modules", "@my-tsconfig", "base", "src", "util.ts", ), ); done(); }); }); }); // Regression for webpack/webpack#21551: published packages often ship a // monorepo tsconfig.json whose `extends` points at a repo-root file that // is not published (e.g. `../../tsconfig-base.json`). With `tsconfig: true`, // discovering that file must not abort ordinary resolution inside the package. // Like TypeScript's findConfigFile, the first existing config wins — load // failure soft-fails (no paths) and must not fall through to a parent // tsconfig's path mappings. describe("bug: published package tsconfig with missing relative extends (#21551)", () => { const brokenPkgExtendsDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "broken-pkg-extends", ); const pkgDir = path.join( brokenPkgExtendsDir, "node_modules", "@scope", "pkg", ); it("should resolve a relative request inside the package when tsconfig: true finds its broken tsconfig.json", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], mainFields: ["main"], mainFiles: ["index"], tsconfig: true, }); resolver.resolve( {}, path.join(pkgDir, "dist"), "./sibling", {}, (err, result) => { if (err) return done(err); if (!result) return done(new Error("No result")); assert.deepStrictEqual( result, path.join(pkgDir, "dist", "sibling.js"), ); done(); }, ); }); it("must not apply a parent tsconfig's paths after the nearer config fails to load", (t, done) => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".js"], mainFields: ["main"], mainFiles: ["index"], tsconfig: true, }); resolver.resolve( {}, path.join(pkgDir, "dist"), "@app/hello", {}, (err, result) => { // Parent broken-pkg-extends/tsconfig.json maps @app/* → ./src/*, // but TypeScript stops at the package's own (broken) config and // does not adopt the parent's paths. if ( !err && result === path.join(brokenPkgExtendsDir, "src", "hello.js") ) { return done( new Error( "incorrectly applied parent tsconfig paths after load failure", ), ); } assert.ok(err, "expected @app/hello not to resolve via parent paths"); done(); }, ); }); }); describe("extends a missing relative path containing slashes", () => { const missingRelativeSlashDir = path.resolve( __dirname, "fixtures", "tsconfig-paths", "extends-missing-relative-slash", ); it("surfaces ENOENT for the joined relative path, not a mangled node_modules path", () => { const resolver = ResolverFactory.createResolver({ fileSystem, extensions: [".ts", ".tsx"], mainFields: ["browser", "main"], mainFiles: ["index"], tsconfig: path.join(missingRelativeSlashDir, "tsconfig.json"), useSyncFileSystemCalls: true, }); const expectedMissing = path.resolve( missingRelativeSlashDir, "..", "..", "tsconfig-base.json", ); let err; try { resolver.resolveSync({}, missingRelativeSlashDir, "@x/y"); } catch (err_) { err = err_; } assert.ok(err); assert.strictEqual( /** @type {NodeJS.ErrnoException} */ (err).code, "ENOENT", ); assert.ok( /** @type {Error} */ (err).message.includes(expectedMissing), `expected error to mention ${expectedMissing}, got: ${ /** @type {Error} */ (err).message }`, ); assert.ok( !( /** @type {Error} */ (err).message.includes( `${path.sep}tsconfig-paths${path.sep}tsconfig-base.json`, ) ), "must not rewrite ../../tsconfig-base.json via node_modules fallback", ); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/uint8array-fs.test.js000066400000000000000000000053361523262174200241530ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const ResolverFactory = require("../lib/ResolverFactory"); const { describe, it } = require("./_runner"); // Regression test: a file system that returns Uint8Array (as a browser/Deno FS // would) instead of a Node Buffer must still have its package.json description // files parsed. Previously DescriptionFileUtils called `content.toString()`, // which stringifies a Uint8Array to a comma-separated byte list. describe("Uint8Array file system", () => { const fileMap = { "/app/index.js": "", "/app/node_modules/pkg/package.json": JSON.stringify({ name: "pkg", main: "lib/main.js", exports: { ".": "./lib/main.js", "./feature": "./lib/feature.js" }, }), "/app/node_modules/pkg/lib/main.js": "", "/app/node_modules/pkg/lib/feature.js": "", }; const files = new Map(Object.entries(fileMap)); const dirs = new Set(["/"]); for (const filePath of files.keys()) { let dir = filePath; let idx = dir.lastIndexOf("/"); while (idx > 0) { dir = dir.slice(0, idx); dirs.add(dir); idx = dir.lastIndexOf("/"); } } const stat = (isFile) => ({ isFile: () => isFile, isDirectory: () => !isFile, isSymbolicLink: () => false, isBlockDevice: () => false, isCharacterDevice: () => false, isFIFO: () => false, isSocket: () => false, }); const enoent = (pth) => { const err = /** @type {NodeJS.ErrnoException} */ ( new Error(`ENOENT: ${pth}`) ); err.code = "ENOENT"; return err; }; const statSync = (arg) => { const pth = String(arg); if (files.has(pth)) return stat(true); if (dirs.has(pth)) return stat(false); throw enoent(pth); }; const fileSystem = { statSync, lstatSync: statSync, realpathSync: (arg) => `${arg}`, readlinkSync: () => { const err = /** @type {NodeJS.ErrnoException} */ (new Error("EINVAL")); err.code = "EINVAL"; throw err; }, readdirSync: () => [], // The crux of the test: return a Uint8Array, never a Node Buffer. readFileSync: (arg) => { const pth = String(arg); if (!files.has(pth)) throw enoent(pth); return new TextEncoder().encode(files.get(pth)); }, }; const resolver = ResolverFactory.createResolver({ extensions: [".js", ".json"], conditionNames: ["node", "import"], // @ts-expect-error minimal structural file system for the test fileSystem, useSyncFileSystemCalls: true, }); it("resolves a package main field read from a Uint8Array package.json", () => { assert.strictEqual( resolver.resolveSync({}, "/app", "pkg"), "/app/node_modules/pkg/lib/main.js", ); }); it("resolves an exports subpath read from a Uint8Array package.json", () => { assert.strictEqual( resolver.resolveSync({}, "/app", "pkg/feature"), "/app/node_modules/pkg/lib/feature.js", ); }); }); webpack-enhanced-resolve-7dfc9bc/test/unc-paths.test.js000066400000000000000000000056051523262174200233400ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { ResolverFactory } = require("../"); const { describe, it } = require("./_runner"); // UNC paths (`\\server\share\…`) are Windows-only constructs addressing a // network share, so a real one cannot be mounted in CI. The resolver picks the // path flavor from the path itself rather than from the host, so a fake // filesystem exercises the same code paths on every platform. const share = "\\\\server\\share\\a"; const files = new Map([ [`${share}\\package.json`, '{"main":"./main.js"}'], [`${share}\\main.js`, "module.exports = 1;"], [`${share}\\sub\\index.js`, "module.exports = 2;"], ]); const directories = new Set([ "\\\\server\\share", share, `${share}\\sub`, `${share}\\node_modules`, ]); const createFileSystem = () => { const enoent = (requested) => { const err = /** @type {NodeJS.ErrnoException} */ ( new Error(`ENOENT: no such file or directory, '${requested}'`) ); err.code = "ENOENT"; throw err; }; const fileSystem = { statSync: (requested) => { const isFile = files.has(requested); if (!isFile && !directories.has(requested)) return enoent(requested); return { isFile: () => isFile, isDirectory: () => !isFile, isSymbolicLink: () => false, }; }, lstatSync: (requested) => fileSystem.statSync(requested), readFileSync: (requested) => { const content = files.get(requested); return content === undefined ? enoent(requested) : content; }, readdirSync: enoent, readlinkSync: enoent, }; return fileSystem; }; const createResolver = () => ResolverFactory.createResolver({ extensions: [".js"], useSyncFileSystemCalls: true, // @ts-expect-error a minimal filesystem is enough for these cases fileSystem: createFileSystem(), }); describe("UNC path resolution", () => { it("should resolve a relative request against a UNC context", (t, done) => { createResolver().resolve( {}, `${share}\\sub`, "./index.js", {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, `${share}\\sub\\index.js`); done(); }, ); }); it("should resolve a directory request against a UNC context", (t, done) => { createResolver().resolve({}, share, "./sub/index.js", {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, `${share}\\sub\\index.js`); done(); }); }); it("should treat an absolute UNC request as a path, not a module", (t, done) => { createResolver().resolve( {}, "/somewhere/else", `${share}\\sub\\index.js`, {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, `${share}\\sub\\index.js`); done(); }, ); }); it("should use the description file of a UNC directory", (t, done) => { createResolver().resolve({}, share, ".", {}, (err, result) => { if (err) return done(err); assert.strictEqual(result, `${share}\\main.js`); done(); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/unsafe-cache.test.js000066400000000000000000000170251523262174200237570ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const path = require("path"); const resolve = require("../"); const { beforeEach, describe, it } = require("./_runner"); describe("unsafe-cache", () => { let cache; let cachedResolve; let context; let otherContext; const fixturePath = path.join( __dirname, "fixtures", "unsafe-cache-normalization", ); const nestedFixturePath = path.join(fixturePath, "packages", "nested"); const shadowedContext = path.join(fixturePath, "src", "components"); const deepContext = path.join(fixturePath, "src", "a", "b"); const shallowContext = path.join(fixturePath, "src", "b"); const nestedContext = path.join(nestedFixturePath, "src"); const rootReactTarget = path.join( fixturePath, "node_modules", "react", "index.js", ); const rootSharedTarget = path.join(fixturePath, "src", "shared", "index.js"); const rootSharedPackageTarget = path.join( fixturePath, "node_modules", "shared", "index.js", ); const nestedReactTarget = path.join( nestedFixturePath, "node_modules", "react", "index.js", ); const shadowedReactTarget = path.join( fixturePath, "src", "components", "node_modules", "react", "index.js", ); /** * @param {string} value cache path value * @returns {void} */ function poisonCache(value) { for (const key of Object.keys(cache)) { cache[key] = { path: value, }; } } beforeEach(() => { context = { some: "context", }; otherContext = { someOther: "context", }; }); describe("with no other options", () => { beforeEach(() => { cache = {}; cachedResolve = resolve.create({ unsafeCache: cache, }); }); it("should cache request", (t, done) => { cachedResolve( path.join(__dirname, "fixtures"), "m2/b", (err, _result) => { if (err) return done(err); assert.strictEqual(Object.keys(cache).length, 1); for (const key of Object.keys(cache)) { cache[key] = { path: "yep", }; } cachedResolve( path.join(__dirname, "fixtures"), "m2/b", (err, result) => { if (err) return done(err); assert.strictEqual(result, "yep"); done(); }, ); }, ); }); it("should not return from cache if context does not match", (t, done) => { cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", (err, _result) => { if (err) return done(err); assert.strictEqual(Object.keys(cache).length, 1); for (const key of Object.keys(cache)) { cache[key] = { path: "yep", }; } cachedResolve( otherContext, path.join(__dirname, "fixtures"), "m2/b", (err, result) => { if (err) return done(err); assert.notStrictEqual(result, "yep"); done(); }, ); }, ); }); it("should not return from cache if query does not match", (t, done) => { cachedResolve( path.join(__dirname, "fixtures"), "m2/b?query", (err, _result) => { if (err) return done(err); assert.strictEqual(Object.keys(cache).length, 1); for (const key of Object.keys(cache)) { cache[key] = { path: "yep", }; } cachedResolve( path.join(__dirname, "fixtures"), "m2/b?query2", (err, result) => { if (err) return done(err); assert.notStrictEqual(result, "yep"); done(); }, ); }, ); }); }); describe("with cacheWithContext false", () => { beforeEach(() => { cache = {}; cachedResolve = resolve.create({ unsafeCache: cache, cacheWithContext: false, }); }); it("should cache request", (t, done) => { cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", (err, _result) => { if (err) return done(err); assert.strictEqual(Object.keys(cache).length, 1); for (const key of Object.keys(cache)) { cache[key] = { path: "yep", }; } cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", (err, result) => { if (err) return done(err); assert.strictEqual(result, "yep"); done(); }, ); }, ); }); it("should return from cache even if context does not match", (t, done) => { cachedResolve( context, path.join(__dirname, "fixtures"), "m2/b", (err, _result) => { if (err) return done(err); assert.strictEqual(Object.keys(cache).length, 1); for (const key of Object.keys(cache)) { cache[key] = { path: "yep", }; } cachedResolve( otherContext, path.join(__dirname, "fixtures"), "m2/b", (err, result) => { if (err) return done(err); assert.strictEqual(result, "yep"); done(); }, ); }, ); }); }); describe("with package-normalized cache keys", () => { beforeEach(() => { cache = {}; cachedResolve = resolve.create.sync({ unsafeCache: cache, }); }); it("should keep bare specifier cache keys tied to the lookup directory", () => { assert.strictEqual(cachedResolve(deepContext, "react"), rootReactTarget); poisonCache("cache-hit"); assert.strictEqual( cachedResolve(shallowContext, "react"), rootReactTarget, ); }); it("should reuse cached results for relative requests inside one package", () => { assert.strictEqual( cachedResolve(deepContext, "../../shared"), rootSharedTarget, ); poisonCache("cache-hit"); assert.strictEqual( cachedResolve(shallowContext, "../shared"), "cache-hit", ); }); it("should not reuse cached results across package boundaries", () => { assert.strictEqual(cachedResolve(deepContext, "react"), rootReactTarget); poisonCache("cache-hit"); assert.strictEqual( cachedResolve(nestedContext, "react"), nestedReactTarget, ); }); it("should not reuse cached bare specifiers when a nested node_modules shadows the package root", () => { assert.strictEqual( cachedResolve(shallowContext, "react"), rootReactTarget, ); poisonCache("cache-hit"); assert.strictEqual( cachedResolve(shadowedContext, "react"), shadowedReactTarget, ); }); it("should keep relative requests distinct from bare specifiers", () => { assert.strictEqual( cachedResolve(deepContext, "../../shared"), rootSharedTarget, ); poisonCache("cache-hit"); assert.strictEqual( cachedResolve(shallowContext, "shared"), rootSharedPackageTarget, ); }); }); describe("unsafe-cache more tests", () => { const fixtures = path.join(__dirname, "fixtures"); it("passes through without caching when cachePredicate returns false", (t, done) => { const cache = {}; const cachedResolve = resolve.create({ // @ts-expect-error for tests unsafeCache: cache, cachePredicate: () => false, }); cachedResolve(fixtures, "./a.js", (err, result) => { if (err) return done(err); assert.deepStrictEqual(result, path.join(fixtures, "a.js")); assert.strictEqual(Object.keys(cache).length, 0); done(); }); }); it("returns a poisoned cache entry on a re-resolve (non-array branch)", (t, done) => { const cache = {}; const cachedResolve = resolve.create({ // @ts-expect-error for tests unsafeCache: cache, }); cachedResolve(fixtures, "./a.js", (err) => { if (err) return done(err); for (const key of Object.keys(cache)) { cache[key] = { path: "poisoned" }; } cachedResolve(fixtures, "./a.js", (err2, result) => { if (err2) return done(err2); assert.strictEqual(result, "poisoned"); done(); }); }); }); }); }); webpack-enhanced-resolve-7dfc9bc/test/util-fs.test.js000066400000000000000000000154541523262174200230240ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const { decodeText, readJson } = require("../lib/util/fs"); const { describe, it } = require("./_runner"); /* eslint-disable jsdoc/reject-any-type */ // `readJson` is the JSONC loader used internally by TsconfigPathsPlugin. // The plugin always passes stripComments:true, so the readJson-fast path // and other branches have no integration callers and are tested directly. /** * @param {any} fileSystem file system * @param {string} jsonFilePath path * @param {{ stripComments?: boolean }=} options options * @returns {Promise} parsed JSON */ function readJsonPromise(fileSystem, jsonFilePath, options = {}) { return new Promise((resolve, reject) => { readJson(fileSystem, jsonFilePath, options, (err, content) => { if (err) return reject(err); resolve(content); }); }); } describe("util/fs readJson", () => { it("uses fileSystem.readJson when available and stripComments is false", async () => { const content = { name: "fast-path" }; const fileSystem = /** @type {any} */ ({ readJson(_p, callback) { callback(null, content); }, readFile(_p, callback) { callback(new Error("should not be called")); }, }); const result = await readJsonPromise(fileSystem, "/a/package.json"); assert.deepStrictEqual(result, content); }); it("rejects if readJson yields an error", async () => { const fileSystem = /** @type {any} */ ({ readJson(_p, callback) { callback(new Error("boom")); }, readFile(_p, callback) { callback(null, Buffer.from("{}")); }, }); await assert.rejects( readJsonPromise(fileSystem, "/a/package.json"), (err) => err instanceof Error && err.message.includes("boom"), ); }); it("falls back to readFile when stripComments is true", async () => { const fileSystem = /** @type {any} */ ({ readJson(_p, callback) { callback(new Error("should not be called")); }, readFile(_p, callback) { callback( null, Buffer.from('{\n// comment\n"a": 1, /*x*/ "b": [1,2,],\n}'), ); }, }); const result = await readJsonPromise(fileSystem, "/a/tsconfig.json", { stripComments: true, }); assert.deepStrictEqual(result, { a: 1, b: [1, 2] }); }); it("falls back to readFile when readJson is unavailable", async () => { const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { callback(null, Buffer.from('{"hello": "world"}')); }, }); const result = await readJsonPromise(fileSystem, "/a/package.json"); assert.deepStrictEqual(result, { hello: "world" }); }); it("decodes a Uint8Array (non-Node file system) result", async () => { const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { callback(null, new TextEncoder().encode('{"hello": "world"}')); }, }); const result = await readJsonPromise(fileSystem, "/a/package.json"); assert.deepStrictEqual(result, { hello: "world" }); }); it("decodes a Uint8Array result when stripping comments", async () => { const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { callback( null, new TextEncoder().encode( '{\n// comment\n"a": 1, /*x*/ "b": [1,2,],\n}', ), ); }, }); const result = await readJsonPromise(fileSystem, "/a/tsconfig.json", { stripComments: true, }); assert.deepStrictEqual(result, { a: 1, b: [1, 2] }); }); it("rejects when readFile errors", async () => { const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { callback(new Error("read-fail")); }, }); await assert.rejects( readJsonPromise(fileSystem, "/a/package.json"), (err) => err instanceof Error && err.message.includes("read-fail"), ); }); it("invokes the callback synchronously when the file system is synchronous", () => { const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { callback(null, Buffer.from('{"sync": true}')); }, }); let sync = false; let result; readJson( fileSystem, "/a/tsconfig.json", { stripComments: true }, (err, content) => { if (err) throw err; result = content; sync = true; }, ); assert.strictEqual(sync, true); assert.deepStrictEqual(result, { sync: true }); }); // Regression: a file system may return a string from readFile (more likely // off Node). The strip-comments cache is a WeakMap, so a string key must not // be used — previously this threw "Invalid value used as weak map key". it("parses string content with stripComments without throwing", async () => { const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { callback(null, '{\n// c\n"a": 1, /* x */ "b": [1, 2,],\n}'); }, }); const result = await readJsonPromise(fileSystem, "/a/tsconfig.json", { stripComments: true, }); assert.deepStrictEqual(result, { a: 1, b: [1, 2] }); }); it("parses string content without stripComments", async () => { const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { callback(null, '{"hello": "world"}'); }, }); const result = await readJsonPromise(fileSystem, "/a/package.json"); assert.deepStrictEqual(result, { hello: "world" }); }); it("serves repeated stripComments reads of the same buffer from cache", async () => { const buf = new TextEncoder().encode('{ /* c */ "cached": true, }'); let reads = 0; const fileSystem = /** @type {any} */ ({ readFile(_p, callback) { reads++; callback(null, buf); }, }); const a = await readJsonPromise(fileSystem, "/a/tsconfig.json", { stripComments: true, }); const b = await readJsonPromise(fileSystem, "/a/tsconfig.json", { stripComments: true, }); assert.deepStrictEqual(a, { cached: true }); assert.strictEqual(b, a); // same cached object instance for the same buffer assert.strictEqual(reads, 2); }); }); describe("util/fs decodeText", () => { it("returns a string unchanged", () => { assert.strictEqual(decodeText("日本語"), "日本語"); }); it("decodes a Node Buffer as utf-8", () => { assert.strictEqual(decodeText(Buffer.from("日本語", "utf8")), "日本語"); }); it("decodes a Uint8Array as utf-8", () => { assert.strictEqual( decodeText(new TextEncoder().encode("日本語")), "日本語", ); }); it("decodes an empty Uint8Array to an empty string", () => { assert.strictEqual(decodeText(new Uint8Array(0)), ""); }); it("decodes multi-byte characters across the buffer", () => { const text = "中文 — emoji 😀 — π"; assert.strictEqual(decodeText(new TextEncoder().encode(text)), text); }); it("keeps a leading BOM identically for Buffer and Uint8Array", () => { const text = `${"\uFEFF"}{"a":1}`; const fromBuffer = decodeText(Buffer.from(text, "utf8")); const fromU8 = decodeText(new TextEncoder().encode(text)); // Both keep the BOM (matching Buffer.toString), so the two paths agree. assert.strictEqual(fromBuffer, text); assert.strictEqual(fromU8, fromBuffer); }); }); webpack-enhanced-resolve-7dfc9bc/test/yield.test.js000066400000000000000000000411541523262174200225430ustar00rootroot00000000000000"use strict"; const assert = require("assert"); const fs = require("fs"); const path = require("path"); const { ResolverFactory } = require("../"); const CachedInputFileSystem = require("../lib/CachedInputFileSystem"); const { describe, it } = require("./_runner"); /** @typedef {import("../lib/Resolver").ResolveRequest} ResolveRequest */ /** @typedef {import("../lib/Resolver").ResolveContext} ResolveContext */ /** @typedef {import("../lib/UnsafeCachePlugin").Cache} Cache */ /** @typedef {ResolveContext & Required>} StrictResolveContext */ const nodeFileSystem = new CachedInputFileSystem(fs, 4000); const fixtures = path.resolve(__dirname, "fixtures", "yield"); const makeFixturePaths = (paths) => paths.map((pth) => (pth ? path.join(fixtures, pth) : pth)); const contextifyDependencies = (paths) => [...paths] .filter((pth) => pth.startsWith(fixtures)) .map((pth) => pth.slice(fixtures.length).split(path.sep).join("/")) .sort(); const beatifyLogs = (logs) => logs.map((l) => { const match = /^(\s+)using description file.+(\(relative path:.+\))$/.exec( l, ); if (match) return `${match[1]}using description file ${match[2]}`; while (l.includes(fixtures)) l = l.replace(fixtures, "fixtures"); return l; }); describe("should resolve all aliases", () => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { index: makeFixturePaths(["/a/foo", "/a/foo-2"]), foo: false, }, aliasFields: ["browser"], fileSystem: nodeFileSystem, }); const modulesResolver = ResolverFactory.createResolver({ extensions: [".js"], modules: makeFixturePaths(["a", "b"]), fileSystem: nodeFileSystem, }); it("should yield all b files", (t, done) => { const paths = []; const yield_ = ({ path }) => paths.push(path); const fileDependencies = new Set(); const contextDependencies = new Set(); const missingDependencies = new Set(); /** @type {ResolveContext} */ const context = { yield: yield_, fileDependencies, contextDependencies, missingDependencies, }; resolver.resolve({}, fixtures, "index/b", context, (err, result) => { assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual( paths, makeFixturePaths(["/a/foo/b", "/a/foo-2/b"]), ); assert.deepStrictEqual(contextifyDependencies(fileDependencies), [ "", "/a", "/a/foo", "/a/foo-2", "/a/foo-2/b", "/a/foo/b", ]); assert.deepStrictEqual(contextifyDependencies(missingDependencies), [ "/a/foo-2/b", "/a/foo-2/b.js", "/a/foo-2/package.json", "/a/foo/b", "/a/foo/b.js", "/a/foo/package.json", "/a/package.json", "/package.json", ]); assert.deepStrictEqual([...contextDependencies].sort(), []); done(); }); }); it("should yield all foo files", (t, done) => { const paths = []; const yield_ = ({ path }) => paths.push(path); const fileDependencies = new Set(); const contextDependencies = new Set(); const missingDependencies = new Set(); /** @type {ResolveContext} */ const context = { yield: yield_, fileDependencies, contextDependencies, missingDependencies, }; modulesResolver.resolve({}, fixtures, "foo/a", context, (err, result) => { assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, makeFixturePaths(["/a/foo/a", "/b/foo/a"])); assert.deepStrictEqual(contextifyDependencies(fileDependencies), [ "", "/a", "/a/foo", "/a/foo/a", "/b", "/b/foo", "/b/foo/a", ]); assert.deepStrictEqual(contextifyDependencies(missingDependencies), [ "/a/foo/a", "/a/foo/a.js", "/a/foo/package.json", "/a/package.json", "/b/foo/a", "/b/foo/a.js", "/b/foo/package.json", "/b/package.json", "/package.json", ]); assert.deepStrictEqual([...contextDependencies].sort(), []); done(); }); }); it("should yield c file", (t, done) => { const paths = []; const yield_ = ({ path }) => paths.push(path); /** @type {ResolveContext} */ const context = { yield: yield_, }; resolver.resolve({}, fixtures, "index/c", context, (err, result) => { assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, makeFixturePaths(["/a/foo-2/c"])); done(); }); }); it("should resolve false alias", (t, done) => { const paths = []; const yield_ = ({ path }) => paths.push(path); const fileDependencies = new Set(); const contextDependencies = new Set(); const missingDependencies = new Set(); /** @type {ResolveContext} */ const context = { yield: yield_, fileDependencies, contextDependencies, missingDependencies, }; resolver.resolve({}, fixtures, "foo", context, (err, result) => { assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, [false]); assert.deepStrictEqual(contextifyDependencies(fileDependencies), []); assert.deepStrictEqual(contextifyDependencies(missingDependencies), [ "/node_modules", "/package.json", ]); assert.deepStrictEqual([...contextDependencies].sort(), []); done(); }); }); it("should return error if no resolve", (t, done) => { const paths = []; const yield_ = ({ path }) => paths.push(path); const fileDependencies = new Set(); const contextDependencies = new Set(); const missingDependencies = new Set(); /** @type {ResolveContext} */ const context = { yield: yield_, fileDependencies, contextDependencies, missingDependencies, }; resolver.resolve({}, fixtures, "index/unknown", context, (err, result) => { assert.notStrictEqual(err, null); assert.notStrictEqual(err, undefined); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, []); assert.deepStrictEqual(contextifyDependencies(fileDependencies), []); assert.deepStrictEqual(contextifyDependencies(missingDependencies), [ "/a/foo-2/package.json", "/a/foo-2/unknown", "/a/foo-2/unknown.js", "/a/foo/package.json", "/a/foo/unknown", "/a/foo/unknown.js", "/a/package.json", "/package.json", ]); assert.deepStrictEqual([...contextDependencies].sort(), []); done(); }); }); describe("resolve alias field", () => { it("should handle false in alias field", (t, done) => { const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { index: makeFixturePaths(["/c/foo"]), }, aliasFields: ["browser"], fileSystem: nodeFileSystem, }); let calls = 0; const paths = []; const logs = []; const yield_ = ({ path }) => { paths.push(path); }; const fileDependencies = new Set(); const contextDependencies = new Set(); const missingDependencies = new Set(); /** @type {ResolveContext} */ const context = { yield: yield_, fileDependencies, contextDependencies, missingDependencies, log: (l) => logs.push(l), }; resolver.resolve({}, fixtures, "index/a", context, (err, result) => { calls++; assert.strictEqual(calls, 1); assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, [false]); assert.deepStrictEqual(contextifyDependencies(fileDependencies), [ "/c/foo/package.json", ]); assert.deepStrictEqual(contextifyDependencies(missingDependencies), [ "/c/foo/a", "/c/foo/a.js", "/package.json", ]); assert.deepStrictEqual([...contextDependencies].sort(), []); assert.deepStrictEqual(beatifyLogs(logs), [ "resolve 'index/a' in 'fixtures'", " Parsed request is a module", " using description file (relative path: ./test/fixtures/yield)", ` aliased with mapping 'index': '${["fixtures", "c", "foo"].join( path.sep, )}' to '${["fixtures", "c", "foo"].join(path.sep)}/a'`, " using description file (relative path: ./test/fixtures/yield)", " using description file (relative path: ./a)", " .js", ` ${["fixtures", "c", "foo", "a.js"].join( path.sep, )} doesn't exist`, " as directory", ` ${["fixtures", "c", "foo", "a"].join( path.sep, )} is not a directory`, ]); done(); }); }); describe("alias + alias field", () => { const createResolver = (aliases) => ResolverFactory.createResolver({ extensions: [".js"], alias: { index: makeFixturePaths(aliases), }, aliasFields: ["browser"], fileSystem: nodeFileSystem, }); const cLog = [ ` aliased with mapping 'index': '${["fixtures", "c", "foo"].join( path.sep, )}' to '${["fixtures", "c", "foo"].join(path.sep)}/a'`, " using description file (relative path: ./test/fixtures/yield)", " using description file (relative path: ./a)", " .js", ` ${["fixtures", "c", "foo", "a.js"].join( path.sep, )} doesn't exist`, " as directory", ` ${["fixtures", "c", "foo", "a"].join( path.sep, )} is not a directory`, ]; const aLog = [ ` aliased with mapping 'index': '${["fixtures", "a", "foo"].join( path.sep, )}' to '${["fixtures", "a", "foo"].join(path.sep)}/a'`, " using description file (relative path: ./test/fixtures/yield)", " using description file (relative path: ./test/fixtures/yield/a/foo/a)", " no extension", ` existing file: ${["fixtures", "a", "foo", "a"].join( path.sep, )}`, ` reporting result ${["fixtures", "a", "foo", "a"].join( path.sep, )}`, " .js", ` ${["fixtures", "a", "foo", "a.js"].join( path.sep, )} doesn't exist`, " as directory", ` ${["fixtures", "a", "foo", "a"].join( path.sep, )} is not a directory`, ]; let resolver; /** * @param {(err?: null) => void} done done * @param {(string | false)[]} expectedResult expected result * @param {string[]} expectedLogs expected logs */ function run(done, expectedResult, expectedLogs) { let calls = 0; const paths = []; const logs = []; const yield_ = ({ path }) => paths.push(path); const fileDependencies = new Set(); const contextDependencies = new Set(); const missingDependencies = new Set(); /** @type {ResolveContext} */ const context = { yield: yield_, fileDependencies, contextDependencies, missingDependencies, log: (l) => logs.push(l), }; resolver.resolve({}, fixtures, "index/a", context, (err, result) => { calls++; assert.strictEqual(calls, 1); assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, makeFixturePaths(expectedResult)); assert.deepStrictEqual(contextifyDependencies(fileDependencies), [ "", "/a", "/a/foo", "/a/foo/a", "/c/foo/package.json", ]); assert.deepStrictEqual(contextifyDependencies(missingDependencies), [ "/a/foo/a", "/a/foo/a.js", "/a/foo/package.json", "/a/package.json", "/c/foo/a", "/c/foo/a.js", "/package.json", ]); assert.deepStrictEqual([...contextDependencies].sort(), []); assert.deepStrictEqual(beatifyLogs(logs), expectedLogs); done(); }); } it("default order", (t, done) => { resolver = createResolver(["/c/foo", "/a/foo"]); run( done, [false, "/a/foo/a"], [ "resolve 'index/a' in 'fixtures'", " Parsed request is a module", " using description file (relative path: ./test/fixtures/yield)", ...cLog, ...aLog, ], ); }); it("reverse order", (t, done) => { resolver = createResolver(["/a/foo", "/c/foo"]); run( done, ["/a/foo/a", false], [ "resolve 'index/a' in 'fixtures'", " Parsed request is a module", " using description file (relative path: ./test/fixtures/yield)", ...aLog, ...cLog, ], ); }); }); describe("custom plugins", () => { const createResolver = (plugin) => ResolverFactory.createResolver({ extensions: [".js"], plugins: [plugin], fileSystem: nodeFileSystem, }); it("should correctly handle resolve in callback", (t, done) => { const getResult = (request) => ({ ...request, path: "/a" }); const resolver = createResolver({ apply(resolver) { resolver .getHook("described-resolve") .tapAsync( "MyResolverPlugin", (request, resolveContext, callback) => { callback(null, getResult(request)); }, ); }, }); const paths = []; const context = { yield: (obj) => paths.push(obj.path), }; resolver.resolve({}, fixtures, "unknown", context, (err, result) => { if (err) done(err); assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, ["/a"]); done(); }); }); it("should correctly handle error in callback", (t, done) => { const resolver = createResolver({ apply(resolver) { resolver .getHook("described-resolve") .tapAsync("MyResolverPlugin", (_, __, callback) => callback(new Error("error")), ); }, }); const paths = []; const context = { yield: (obj) => paths.push(obj.path), }; resolver.resolve({}, fixtures, "unknown", context, (err, result) => { if (!err) return done(new Error("error expected")); assert.notStrictEqual(err, null); assert.strictEqual(err.message, "error"); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, []); done(); }); }); }); describe("unsafe cache", () => { // same case as in "should yield all b files" it("should return result from cache", (t, done) => { const cache = /** @type {Cache} */ ({}); const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { index: makeFixturePaths(["/a/foo", "/a/foo-2"]), }, unsafeCache: cache, fileSystem: nodeFileSystem, }); resolver.resolve( {}, fixtures, "index/b", { yield: () => {} }, (err) => { if (err) done(err); const paths = []; resolver.resolve( {}, fixtures, "index/b", { yield: (obj) => paths.push(obj.path) }, (err, result) => { assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual( paths, makeFixturePaths(["/a/foo/b", "/a/foo-2/b"]), ); // original + 2 aliases assert.strictEqual(Object.keys(cache).length, 3); const cacheId = /** @type {string} */ ( Object.keys(cache).find((id) => { // Cache keys are "type\0context\0path\0query\0fragment\0request". // We only need the request field for this assertion. // const parts = id.split("\0"); // return parts[parts.length - 1] === "index/b"; const { request } = JSON.parse(id); return request === "index/b"; }) ); assert.notStrictEqual(cacheId, undefined); assert.strictEqual(Array.isArray(cache[cacheId]), true); assert.deepStrictEqual( /** @type {ResolveRequest[]} */ (cache[cacheId]).map((req) => req.path), makeFixturePaths(["/a/foo/b", "/a/foo-2/b"]), ); done(); }, ); }, ); }); // same as "should handle false in alias field" it("should return ignore result from cache", (t, done) => { const cache = /** @type {Cache} */ ({}); const resolver = ResolverFactory.createResolver({ extensions: [".js"], alias: { foo: false, }, unsafeCache: cache, fileSystem: nodeFileSystem, }); resolver.resolve({}, fixtures, "foo", { yield: () => {} }, (err) => { if (err) done(err); const paths = []; resolver.resolve( {}, fixtures, "foo", { yield: (obj) => paths.push(obj.path) }, (err, result) => { assert.strictEqual(err, null); assert.strictEqual(result, undefined); assert.deepStrictEqual(paths, [false]); // original + 0 aliases assert.strictEqual(Object.keys(cache).length, 1); const [cacheId] = Object.keys(cache); assert.notStrictEqual(cacheId, undefined); assert.strictEqual(Array.isArray(cache[cacheId]), true); assert.deepStrictEqual( /** @type {ResolveRequest[]} */ (cache[cacheId]).map((req) => req.path), [false], ); done(); }, ); }); }); }); }); }); webpack-enhanced-resolve-7dfc9bc/tsconfig.json000066400000000000000000000004571523262174200216520ustar00rootroot00000000000000{ "compilerOptions": { "target": "es2018", "module": "commonjs", "lib": ["es2018", "es2024"], "allowJs": true, "checkJs": true, "noEmit": true, "strict": true, "alwaysStrict": true, "types": ["node"], "esModuleInterop": true }, "include": ["lib/**/*.js"] } webpack-enhanced-resolve-7dfc9bc/tsconfig.types.json000066400000000000000000000000361523262174200230060ustar00rootroot00000000000000{ "extends": "./tsconfig" } webpack-enhanced-resolve-7dfc9bc/tsconfig.types.test.json000066400000000000000000000003251523262174200237650ustar00rootroot00000000000000{ "extends": "./tsconfig", "compilerOptions": { "strict": false, "noImplicitThis": true, "alwaysStrict": true, "strictNullChecks": true, "types": ["node"] }, "include": ["test/*.js"] } webpack-enhanced-resolve-7dfc9bc/types.d.ts000066400000000000000000001157621523262174200211070ustar00rootroot00000000000000/* * This file was automatically generated. * DO NOT MODIFY BY HAND. * Run `yarn fix:special` to update */ import { Buffer } from "buffer"; import { AsyncSeriesBailHook, AsyncSeriesHook, SyncHook } from "tapable"; import { URL as URL_Import } from "url"; declare interface Abortable { /** * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. */ signal?: AbortSignal; } type Alias = string | false | string[]; declare interface AliasOption { alias: Alias; name: string; onlyModule?: boolean; } type BaseFileSystem = FileSystem & SyncFileSystem; declare interface BaseResolveRequest { /** * path */ path: string | false; /** * content */ context?: Context; /** * description file path */ descriptionFilePath?: string; /** * description file root */ descriptionFileRoot?: string; /** * description file data */ descriptionFileData?: JsonObject; /** * tsconfig paths map */ tsconfigPathsMap?: null | TsconfigPathsMap; /** * relative path */ relativePath?: string; /** * true when need to ignore symlinks, otherwise false */ ignoreSymlinks?: boolean; /** * true when full specified, otherwise false */ fullySpecified?: boolean; /** * inner request for internal usage */ __innerRequest?: string; /** * inner request for internal usage */ __innerRequest_request?: string; /** * inner relative path for internal usage */ __innerRequest_relativePath?: string; /** * internal: shared marker `RestrictionsPlugin` flips when it filters out an existing target, letting `ExportsFieldPlugin` fall back instead of erroring */ __restrictionsMarker?: { blocked: boolean }; } declare interface BasenameCacheEntry { /** * cached dirname function */ fn: (maybePath: string, suffix?: string) => string; /** * the underlying cache map */ cache: Map>; } type BufferEncoding = | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"; type BufferEncodingOption = "buffer" | { encoding: "buffer" }; declare interface Cache { [index: string]: undefined | ResolveRequest | ResolveRequest[]; } declare class CachedInputFileSystem { constructor(fileSystem: BaseFileSystem, duration: number); fileSystem: BaseFileSystem; lstat?: LStat; lstatSync?: LStatSync; stat: Stat; statSync: StatSync; readdir: Readdir; readdirSync: ReaddirSync; readFile: ReadFile; readFileSync: ReadFileSync; readJson?: ( pathOrFileDescription: PathOrFileDescriptor, callback: ( err: null | Error | NodeJS.ErrnoException, result?: JsonObject, ) => void, ) => void; readJsonSync?: (pathOrFileDescription: PathOrFileDescriptor) => JsonObject; readlink: Readlink; readlinkSync: ReadlinkSync; realpath?: RealPath; realpathSync?: RealPathSync; purge( what?: | string | number | URL_url | Buffer | (string | number | URL_url | Buffer)[] | Set, options?: { exact?: boolean }, ): void; } declare class CloneBasenamePlugin { constructor( source: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, target: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, ); source: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >; target: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >; apply(resolver: Resolver): void; } declare interface CompiledAliasOption { /** * original alias name */ name: string; /** * name + "/" — precomputed to avoid per-resolve concat */ nameWithSlash: string; /** * alias target(s) */ alias: Alias; /** * normalized onlyModule flag */ onlyModule: boolean; /** * absolute form of `name` (with slash ending), null when not absolute */ absolutePath: null | string; /** * substring before the single "*" in `name`, null when no wildcard */ wildcardPrefix: null | string; /** * substring after the single "*" in `name`, null when no wildcard */ wildcardSuffix: null | string; /** * first character code of `name` — used as a cheap screen on the hot path. `-1` indicates "matches any first char" (empty wildcard prefix). */ firstCharCode: number; /** * true when `alias` is an array — precomputed so the hot path skips `Array.isArray` */ arrayAlias: boolean; } declare interface CompiledAliasOptions { /** * declaration-ordered list */ all: CompiledAliasOption[]; /** * bucketed by first char code */ byFirstChar: Map; /** * true when an empty-prefix wildcard is present */ hasAnyFirstChar: boolean; /** * true when the bucket fast-path should be used at resolve time */ useBuckets: boolean; } type Context = KnownContext & Record; declare interface Dirent { /** * true when is file, otherwise false */ isFile: () => boolean; /** * true when is directory, otherwise false */ isDirectory: () => boolean; /** * true when is block device, otherwise false */ isBlockDevice: () => boolean; /** * true when is character device, otherwise false */ isCharacterDevice: () => boolean; /** * true when is symbolic link, otherwise false */ isSymbolicLink: () => boolean; /** * true when is FIFO, otherwise false */ isFIFO: () => boolean; /** * true when is socket, otherwise false */ isSocket: () => boolean; /** * name */ name: T; /** * path */ parentPath: string; /** * path */ path?: string; } declare interface DirnameCacheEntry { /** * cached dirname function */ fn: (maybePath: string) => string; /** * the underlying cache map */ cache: Map; } type EncodingOption = | undefined | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | ObjectEncodingOptions; type ErrorWithDetail = Error & { details?: string }; declare interface ExtensionAliasOption { alias: string | string[]; extension: string; } declare interface ExtensionAliasOptions { [index: string]: string | string[]; } declare interface FileSystem { /** * read file method */ readFile: ReadFile; /** * readdir method */ readdir: Readdir; /** * read json method */ readJson?: ( pathOrFileDescription: PathOrFileDescriptor, callback: ( err: null | Error | NodeJS.ErrnoException, result?: JsonObject, ) => void, ) => void; /** * read link method */ readlink: Readlink; /** * lstat method */ lstat?: LStat; /** * stat method */ stat: Stat; /** * realpath method */ realpath?: RealPath; } type IBigIntStats = IStatsBase & { atimeNs: bigint; mtimeNs: bigint; ctimeNs: bigint; birthtimeNs: bigint; }; declare interface IStats { /** * is file */ isFile: () => boolean; /** * is directory */ isDirectory: () => boolean; /** * is block device */ isBlockDevice: () => boolean; /** * is character device */ isCharacterDevice: () => boolean; /** * is symbolic link */ isSymbolicLink: () => boolean; /** * is FIFO */ isFIFO: () => boolean; /** * is socket */ isSocket: () => boolean; /** * dev */ dev: number; /** * ino */ ino: number; /** * mode */ mode: number; /** * nlink */ nlink: number; /** * uid */ uid: number; /** * gid */ gid: number; /** * rdev */ rdev: number; /** * size */ size: number; /** * blksize */ blksize: number; /** * blocks */ blocks: number; /** * atime ms */ atimeMs: number; /** * mtime ms */ mtimeMs: number; /** * ctime ms */ ctimeMs: number; /** * birthtime ms */ birthtimeMs: number; /** * atime */ atime: Date; /** * mtime */ mtime: Date; /** * ctime */ ctime: Date; /** * birthtime */ birthtime: Date; } declare interface IStatsBase { /** * is file */ isFile: () => boolean; /** * is directory */ isDirectory: () => boolean; /** * is block device */ isBlockDevice: () => boolean; /** * is character device */ isCharacterDevice: () => boolean; /** * is symbolic link */ isSymbolicLink: () => boolean; /** * is FIFO */ isFIFO: () => boolean; /** * is socket */ isSocket: () => boolean; /** * dev */ dev: T; /** * ino */ ino: T; /** * mode */ mode: T; /** * nlink */ nlink: T; /** * uid */ uid: T; /** * gid */ gid: T; /** * rdev */ rdev: T; /** * size */ size: T; /** * blksize */ blksize: T; /** * blocks */ blocks: T; /** * atime ms */ atimeMs: T; /** * mtime ms */ mtimeMs: T; /** * ctime ms */ ctimeMs: T; /** * birthtime ms */ birthtimeMs: T; /** * atime */ atime: Date; /** * mtime */ mtime: Date; /** * ctime */ ctime: Date; /** * birthtime */ birthtime: Date; } declare interface Iterator { ( item: T, callback: (err?: null | Error, result?: null | Z) => void, i: number, ): void; } declare interface JoinCacheEntry { /** * cached join function */ fn: (rootPath: string, request: string) => string; /** * the underlying cache map */ cache: Map>; } declare interface JsonObject { [index: string]: | undefined | null | string | number | boolean | JsonObject | JsonValue[]; } type JsonValue = null | string | number | boolean | JsonObject | JsonValue[]; declare interface KnownContext { /** * environments */ environments?: string[]; } declare interface KnownHooks { /** * resolve step hook */ resolveStep: SyncHook< [ AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, ResolveRequest, ] >; /** * no resolve hook */ noResolve: SyncHook<[ResolveRequest, Error]>; /** * resolve hook */ resolve: AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >; /** * result hook */ result: AsyncSeriesHook<[ResolveRequest, ResolveContext]>; } declare interface LStat { ( path: PathLike, callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: undefined | (StatOptions & { bigint?: false }), callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: StatOptions & { bigint: true }, callback: ( err: null | NodeJS.ErrnoException, result?: IBigIntStats, ) => void, ): void; ( path: PathLike, options: undefined | StatOptions, callback: ( err: null | NodeJS.ErrnoException, result?: IStats | IBigIntStats, ) => void, ): void; } declare interface LStatSync { (path: PathLike, options?: undefined): IStats; ( path: PathLike, options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }, ): undefined | IStats; ( path: PathLike, options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }, ): undefined | IBigIntStats; (path: PathLike, options?: StatSyncOptions & { bigint?: false }): IStats; (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; ( path: PathLike, options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }, ): IStats | IBigIntStats; ( path: PathLike, options?: StatSyncOptions, ): undefined | IStats | IBigIntStats; } declare class LogInfoPlugin { constructor( source: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, ); source: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >; apply(resolver: Resolver): void; } declare interface ObjectEncodingOptions { /** * encoding */ encoding?: | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"; } declare interface ParsedIdentifier { /** * request */ request: string; /** * query */ query: string; /** * fragment */ fragment: string; /** * is directory */ directory: boolean; /** * is module */ module: boolean; /** * is file */ file: boolean; /** * is internal */ internal: boolean; } declare interface PathCacheFunctions { /** * cached join */ join: JoinCacheEntry; /** * cached dirname */ dirname: DirnameCacheEntry; /** * cached basename */ basename: BasenameCacheEntry; } type PathLike = string | URL_url | Buffer; type PathOrFileDescriptor = string | number | URL_url | Buffer; type Plugin = | undefined | null | false | "" | 0 | { apply: (this: Resolver, resolver: Resolver) => void } | ((this: Resolver, resolver: Resolver) => void); declare interface PnpApi { /** * resolve to unqualified */ resolveToUnqualified: ( packageName: string, issuer: string, options: { considerBuiltins: boolean }, ) => null | string; } declare interface ReadFile { ( path: PathOrFileDescriptor, options: | undefined | null | ({ encoding?: null; flag?: string } & Abortable), callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; ( path: PathOrFileDescriptor, options: | ({ encoding: BufferEncoding; flag?: string } & Abortable) | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex", callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; ( path: PathOrFileDescriptor, options: | undefined | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | (ObjectEncodingOptions & { flag?: string } & Abortable), callback: ( err: null | NodeJS.ErrnoException, result?: string | Buffer, ) => void, ): void; ( path: PathOrFileDescriptor, callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; } declare interface ReadFileSync { ( path: PathOrFileDescriptor, options?: null | { encoding?: null; flag?: string }, ): Buffer; ( path: PathOrFileDescriptor, options: | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | { encoding: BufferEncoding; flag?: string }, ): string; ( path: PathOrFileDescriptor, options?: | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | (ObjectEncodingOptions & { flag?: string }), ): string | Buffer; } declare interface Readdir { ( path: PathLike, options: | undefined | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | { encoding: | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"; withFileTypes?: false; recursive?: boolean; }, callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void, ): void; ( path: PathLike, options: | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean } | "buffer", callback: (err: null | NodeJS.ErrnoException, files?: Buffer[]) => void, ): void; ( path: PathLike, options: | undefined | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean; }), callback: ( err: null | NodeJS.ErrnoException, files?: string[] | Buffer[], ) => void, ): void; ( path: PathLike, callback: (err: null | NodeJS.ErrnoException, files?: string[]) => void, ): void; ( path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true; recursive?: boolean; }, callback: ( err: null | NodeJS.ErrnoException, files?: Dirent[], ) => void, ): void; ( path: PathLike, options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean }, callback: ( err: null | NodeJS.ErrnoException, files: Dirent[], ) => void, ): void; } declare interface ReaddirSync { ( path: PathLike, options?: | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | { encoding: | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"; withFileTypes?: false; recursive?: boolean; }, ): string[]; ( path: PathLike, options: | "buffer" | { encoding: "buffer"; withFileTypes?: false; recursive?: boolean }, ): Buffer[]; ( path: PathLike, options?: | null | "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex" | (ObjectEncodingOptions & { withFileTypes?: false; recursive?: boolean; }), ): string[] | Buffer[]; ( path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true; recursive?: boolean; }, ): Dirent[]; ( path: PathLike, options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean }, ): Dirent[]; } declare interface Readlink { ( path: PathLike, options: EncodingOption, callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; ( path: PathLike, options: BufferEncodingOption, callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; ( path: PathLike, options: EncodingOption, callback: ( err: null | NodeJS.ErrnoException, result?: string | Buffer, ) => void, ): void; ( path: PathLike, callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; } declare interface ReadlinkSync { (path: PathLike, options?: EncodingOption): string; (path: PathLike, options: BufferEncodingOption): Buffer; (path: PathLike, options?: EncodingOption): string | Buffer; } declare interface RealPath { ( path: PathLike, options: EncodingOption, callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; ( path: PathLike, options: BufferEncodingOption, callback: (err: null | NodeJS.ErrnoException, result?: Buffer) => void, ): void; ( path: PathLike, options: EncodingOption, callback: ( err: null | NodeJS.ErrnoException, result?: string | Buffer, ) => void, ): void; ( path: PathLike, callback: (err: null | NodeJS.ErrnoException, result?: string) => void, ): void; } declare interface RealPathSync { (path: PathLike, options?: EncodingOption): string; (path: PathLike, options: BufferEncodingOption): Buffer; (path: PathLike, options?: EncodingOption): string | Buffer; } declare interface ResolveContext { /** * directories that was found on file system */ contextDependencies?: WriteOnlySet; /** * files that was found on file system */ fileDependencies?: WriteOnlySet; /** * dependencies that was not found on file system */ missingDependencies?: WriteOnlySet; /** * tip of the resolver call stack (a singly-linked list with Set-like API). For instance, `resolve → parsedResolve → describedResolve`. Accepts a legacy `Set` for back-compat with older callers; it is normalized internally without a hot-path branch. */ stack?: StackEntry | Set; /** * log function */ log?: (str: string) => void; /** * yield result, if provided plugins can return several results */ yield?: (request: ResolveRequest) => void; } declare interface ResolveFunction { ( context: Context, parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): string | false; ( parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): string | false; } declare interface ResolveFunctionAsync { ( context: Context, parent: string | URL_url, specifier: string | URL_url, resolveContext: ResolveContext, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; ( context: Context, parent: string | URL_url, specifier: string | URL_url, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; ( parent: string | URL_url, specifier: string | URL_url, resolveContext: ResolveContext, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; ( parent: string | URL_url, specifier: string | URL_url, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; } declare interface ResolveFunctionPromise { ( context: Context, parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): Promise; ( parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): Promise; } type ResolveOptionsOptionalFS = Omit< ResolveOptionsResolverFactoryObject_2, "fileSystem" > & Partial>; declare interface ResolveOptionsResolverFactoryObject_1 { /** * alias */ alias: AliasOption[]; /** * fallback */ fallback: AliasOption[]; /** * alias fields */ aliasFields: Set; /** * extension alias */ extensionAlias: ExtensionAliasOption[]; /** * apply extension alias to exports field targets */ extensionAliasForExports: boolean; /** * cache predicate */ cachePredicate: (predicate: ResolveRequest) => boolean; /** * cache with context */ cacheWithContext: boolean; /** * A list of exports field condition names. */ conditionNames: Set; /** * description files */ descriptionFiles: string[]; /** * enforce extension */ enforceExtension: boolean; /** * exports fields */ exportsFields: Set; /** * imports fields */ importsFields: Set; /** * extensions */ extensions: Set; /** * fileSystem */ fileSystem: FileSystem; /** * unsafe cache */ unsafeCache: false | Cache; /** * symlinks */ symlinks: boolean; /** * resolver */ resolver?: Resolver; /** * modules */ modules: (string | string[])[]; /** * main fields */ mainFields: { name: string[]; forceRelative: boolean }[]; /** * main files */ mainFiles: Set; /** * plugins */ plugins: Plugin[]; /** * pnp API */ pnpApi: null | PnpApi; /** * roots */ roots: Set; /** * fully specified */ fullySpecified: boolean; /** * resolve to context */ resolveToContext: boolean; /** * restrictions */ restrictions: Set; /** * prefer relative */ preferRelative: boolean; /** * prefer absolute */ preferAbsolute: boolean; /** * tsconfig file path or config object */ tsconfig: string | boolean | TsconfigOptions; } declare interface ResolveOptionsResolverFactoryObject_2 { /** * A list of module alias configurations or an object which maps key to value */ alias?: UserAliasOptions | UserAliasOptionEntry[]; /** * A list of module alias configurations or an object which maps key to value, applied only after modules option */ fallback?: UserAliasOptions | UserAliasOptionEntry[]; /** * An object which maps extension to extension aliases */ extensionAlias?: ExtensionAliasOptions; /** * Also apply `extensionAlias` to paths resolved through the package.json `exports` field. Off by default (Node.js-aligned); when enabled, matches TypeScript's behavior for packages that ship TS sources alongside compiled JS. */ extensionAliasForExports?: boolean; /** * A list of alias fields in description files */ aliasFields?: (string | string[])[]; /** * A function which decides whether a request should be cached or not. An object is passed with at least `path` and `request` properties. */ cachePredicate?: (predicate: ResolveRequest) => boolean; /** * Whether or not the unsafeCache should include request context as part of the cache key. */ cacheWithContext?: boolean; /** * A list of description files to read from */ descriptionFiles?: string[]; /** * A list of exports field condition names. */ conditionNames?: string[]; /** * Enforce that a extension from extensions must be used */ enforceExtension?: boolean; /** * A list of exports fields in description files */ exportsFields?: (string | string[])[]; /** * A list of imports fields in description files */ importsFields?: (string | string[])[]; /** * A list of extensions which should be tried for files */ extensions?: string[]; /** * The file system which should be used */ fileSystem: FileSystem; /** * Use this cache object to unsafely cache the successful requests */ unsafeCache?: boolean | Cache; /** * Resolve symlinks to their symlinked location */ symlinks?: boolean; /** * A prepared Resolver to which the plugins are attached */ resolver?: Resolver; /** * A list of directories to resolve modules from, can be absolute path, folder name, or a `file:` `URL` instance */ modules?: string | URL_url | (string | URL_url)[]; /** * A list of main fields in description files */ mainFields?: ( | string | string[] | { name: string | string[]; forceRelative: boolean } )[]; /** * A list of main files in directories */ mainFiles?: string[]; /** * A list of additional resolve plugins which should be applied */ plugins?: Plugin[]; /** * A PnP API that should be used - null is "never", undefined is "auto" */ pnpApi?: null | PnpApi; /** * A list of root paths, each an absolute path or a `file:` `URL` instance */ roots?: (string | URL_url)[]; /** * The request is already fully specified and no extensions or directories are resolved for it */ fullySpecified?: boolean; /** * Resolve to a context instead of a file */ resolveToContext?: boolean; /** * A list of resolve restrictions, each an absolute path, a `file:` `URL` instance, or a RegExp */ restrictions?: (string | RegExp | URL_url)[]; /** * Use only the sync constraints of the file system calls */ useSyncFileSystemCalls?: boolean; /** * Prefer to resolve module requests as relative requests before falling back to modules */ preferRelative?: boolean; /** * Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots */ preferAbsolute?: boolean; /** * TypeScript config file path (or `file:` `URL` instance) or config object with configFile and references */ tsconfig?: string | boolean | URL_url | UserTsconfigOptions; } type ResolveRequest = BaseResolveRequest & Partial; declare abstract class Resolver { fileSystem: FileSystem; options: ResolveOptionsResolverFactoryObject_1; pathCache: PathCacheFunctions; hooks: KnownHooks; ensureHook( name: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, ): AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >; getHook( name: | string | AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, ): AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >; resolveSync( parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): string | false; resolveSync( context: Context, parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): string | false; resolvePromise( parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): Promise; resolvePromise( context: Context, parent: string | URL_url, specifier: string | URL_url, resolveContext?: ResolveContext, ): Promise; resolve( parent: string | URL_url, specifier: string | URL_url, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; resolve( parent: string | URL_url, specifier: string | URL_url, resolveContext: ResolveContext, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; resolve( context: Context, parent: string | URL_url, specifier: string | URL_url, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; resolve( context: Context, parent: string | URL_url, specifier: string | URL_url, resolveContext: ResolveContext, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; doResolve( hook: AsyncSeriesBailHook< [ResolveRequest, ResolveContext], null | ResolveRequest >, request: ResolveRequest, message: null | string, resolveContext: ResolveContext, callback: (err?: null | Error, result?: ResolveRequest) => void, ): void; parse(identifier: string): ParsedIdentifier; isModule(path: string): boolean; isPrivate(path: string): boolean; isDirectory(path: string): boolean; normalize(path: string): string; join(path: string, request: string): string; dirname(path: string): string; basename(path: string, suffix?: string): string; } /** * Singly-linked stack entry that also exposes a Set-like API * (`has`, `size`, iteration). Each `doResolve` call prepends a new * `StackEntry` that points at the previous tip via `.parent`, so pushing * is O(1) in time and memory. Recursion detection walks the linked list * (O(n)) but the stack is typically shallow, so this is cheaper overall * than cloning a `Set` per call. */ declare abstract class StackEntry { name?: string; path: string | false; request: string; query: string; fragment: string; directory: boolean; module: boolean; parent?: StackEntry; /** * Strings seeded by callers that still pass `stack: new Set([...])`. * Propagated through the chain so deeper `doResolve` calls still see * them during recursion checks. `undefined` in the common case so * there is no extra work on the hot path. */ preSeeded?: Set; /** * Walk the linked list looking for an entry with the same request shape. * Set-compatible: callers that used `stack.has(entry)` keep working. * NOTE: kept monomorphic on purpose. An earlier draft accepted a string * query too (so pre-5.21 plugins keeping their own `Set` of * seen entries could probe the live stack with the formatted form), * but adding the second shape regressed `doResolve`'s heap profile by * ~1 MiB / 200 resolves on stack-churn — V8 keeps a polymorphic * call-site state for `parent.has(stackEntry)` once `has` has two * argument shapes. Plugins that need string membership can reach for * `[...stack].find(e => e.includes(formattedString))` via the * `String`-method proxies on `StackEntry` instead. */ has(query: StackEntry): boolean; /** * Number of entries on the stack (oldest-to-newest length). */ get size(): number; /** * Human-readable form used in recursion error messages, logs, and the * iterator above. Not memoized: caching would require an extra slot on * every `StackEntry`, which costs heap even on resolves that never look * at the formatted form. */ toString(): string; /** * Iterate entries from oldest (root) to newest (tip), matching how a * `Set` that was populated in insertion order would iterate. Pre-seeded * legacy `Set` entries come first so error-message output stays * ordered oldest-to-newest. * Yields each entry as its formatted `toString()` form. Plugins written * against the pre-5.21 `Set` shape — e.g. * `[...resolveContext.stack].find(a => a.includes("module:"))` — keep * working unchanged because each yielded value is a plain string with * all of `String.prototype` available natively. Resolves that never * iterate the stack pay nothing; iteration costs one `toString()` * allocation per stack frame. */ [Symbol.iterator](): IterableIterator; } declare interface Stat { ( path: PathLike, callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: undefined | (StatOptions & { bigint?: false }), callback: (err: null | NodeJS.ErrnoException, result?: IStats) => void, ): void; ( path: PathLike, options: StatOptions & { bigint: true }, callback: ( err: null | NodeJS.ErrnoException, result?: IBigIntStats, ) => void, ): void; ( path: PathLike, options: undefined | StatOptions, callback: ( err: null | NodeJS.ErrnoException, result?: IStats | IBigIntStats, ) => void, ): void; } declare interface StatOptions { /** * need bigint values */ bigint?: boolean; } declare interface StatSync { (path: PathLike, options?: undefined): IStats; ( path: PathLike, options?: StatSyncOptions & { bigint?: false; throwIfNoEntry: false }, ): undefined | IStats; ( path: PathLike, options: StatSyncOptions & { bigint: true; throwIfNoEntry: false }, ): undefined | IBigIntStats; (path: PathLike, options?: StatSyncOptions & { bigint?: false }): IStats; (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats; ( path: PathLike, options: StatSyncOptions & { bigint: boolean; throwIfNoEntry?: false }, ): IStats | IBigIntStats; ( path: PathLike, options?: StatSyncOptions, ): undefined | IStats | IBigIntStats; } declare interface StatSyncOptions { /** * need bigint values */ bigint?: boolean; /** * throw if no entry */ throwIfNoEntry?: boolean; } declare interface SyncFileSystem { /** * read file sync method */ readFileSync: ReadFileSync; /** * read dir sync method */ readdirSync: ReaddirSync; /** * read json sync method */ readJsonSync?: (pathOrFileDescription: PathOrFileDescriptor) => JsonObject; /** * read link sync method */ readlinkSync: ReadlinkSync; /** * lstat sync method */ lstatSync?: LStatSync; /** * stat sync method */ statSync: StatSync; /** * real path sync method */ realpathSync?: RealPathSync; } declare interface TsconfigOptions { /** * A relative path to the tsconfig file based on cwd, or an absolute path of tsconfig file */ configFile?: string; /** * References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths */ references?: string[] | "auto"; /** * Override baseUrl from tsconfig.json. If provided, this value will be used instead of the baseUrl in the tsconfig file */ baseUrl?: string; } declare interface TsconfigPathsData { /** * tsconfig file data */ alias: CompiledAliasOptions; /** * tsconfig file data */ modules: string[]; } declare interface TsconfigPathsMap { /** * main tsconfig paths data */ main: TsconfigPathsData; /** * main tsconfig base URL (absolute path) */ mainContext: string; /** * referenced tsconfig paths data mapped by baseUrl */ refs: { [index: string]: TsconfigPathsData }; /** * all contexts (main + refs) for quick lookup */ allContexts: { [index: string]: TsconfigPathsData }; /** * precomputed `Object.keys(allContexts)` — read-only; used on the `_selectPathsDataForContext` hot path */ contextList: string[]; /** * file dependencies */ fileDependencies: Set; } declare class TsconfigPathsPlugin { constructor(configFileOrOptions: string | true | TsconfigOptions); isAutoConfigFile: boolean; configFile: string; references: "auto" | TsconfigReference[]; baseUrl?: string; apply(resolver: Resolver): void; } declare interface TsconfigReference { /** * Path to the referenced project */ path: string; } declare interface URL_url extends URL_Import {} declare interface UserAliasOptionEntry { alias: UserAliasOptionNewRequest; name: string; onlyModule?: boolean; } type UserAliasOptionNewRequest = | string | false | URL_url | (string | URL_url)[]; declare interface UserAliasOptions { [index: string]: UserAliasOptionNewRequest; } declare interface UserTsconfigOptions { /** * A path, or `file:` `URL` instance, pointing at the tsconfig file */ configFile?: string | URL_url; /** * References to other tsconfig files. 'auto' inherits from TypeScript config, or an array of relative/absolute paths or `file:` `URL` instances */ references?: (string | URL_url)[] | "auto"; /** * Override baseUrl from tsconfig.json with a path or `file:` `URL` instance */ baseUrl?: string | URL_url; } declare interface WriteOnlySet { add: (item: T) => void; } declare function exports( context: Context, parent: string | URL_url, specifier: string | URL_url, resolveContext: ResolveContext, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; declare function exports( context: Context, parent: string | URL_url, specifier: string | URL_url, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; declare function exports( parent: string | URL_url, specifier: string | URL_url, resolveContext: ResolveContext, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; declare function exports( parent: string | URL_url, specifier: string | URL_url, callback: ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void, ): void; declare namespace exports { export const sync: ResolveFunction; export const promise: ResolveFunctionPromise; export function create( options: ResolveOptionsOptionalFS, ): ResolveFunctionAsync; export namespace create { export const sync: (options: ResolveOptionsOptionalFS) => ResolveFunction; export const promise: ( options: ResolveOptionsOptionalFS, ) => ResolveFunctionPromise; } export namespace ResolverFactory { export let createResolver: ( options: ResolveOptionsResolverFactoryObject_2, ) => Resolver; } export const forEachBail: ( array: T[], iterator: Iterator, callback: (err?: null | Error, result?: null | Z, i?: number) => void, ) => void; export type ResolveCallback = ( err: null | ErrorWithDetail, res?: string | false, req?: ResolveRequest, ) => void; export { CachedInputFileSystem, CloneBasenamePlugin, LogInfoPlugin, TsconfigPathsPlugin, ResolveOptionsOptionalFS, BaseFileSystem, PnpApi, Resolver, Context, FileSystem, ResolveContext, ResolveRequest, SyncFileSystem, Plugin, ResolveOptionsResolverFactoryObject_2 as ResolveOptions, ResolveFunctionAsync, ResolveFunction, ResolveFunctionPromise, }; } export = exports;